Lagom: Add option to build Ladybird as part of a Lagom build

This means that Ladybird can be built with either Meta/Lagom or Ladybird
as the top-level source directory. This setup is a bit awkward, but will
preserve the packaging story for Ladybird until we come up with a more
permanent solution.
This commit is contained in:
Andrew Kaster 2022-12-23 11:36:45 -07:00 committed by Andrew Kaster
parent b4d80f92ec
commit 0384513779
Notes: sideshowbarker 2024-07-17 02:37:48 +09:00
2 changed files with 17 additions and 0 deletions

View file

@ -12,3 +12,4 @@ serenity_option(ENABLE_FUZZERS_OSSFUZZ OFF CACHE BOOL "Build OSS-Fuzz compatible
serenity_option(BUILD_LAGOM OFF CACHE BOOL "Build parts of the system targeting the host OS for fuzzing/testing")
serenity_option(ENABLE_LAGOM_CCACHE ON CACHE BOOL "Enable ccache for Lagom builds")
serenity_option(ENABLE_LAGOM_LIBWEB ON CACHE BOOL "Enable compiling LibWeb for Lagom builds")
serenity_option(ENABLE_LAGOM_LADYBIRD OFF CACHE BOOL "Enable compiling Ladybird from Lagom")

View file

@ -42,6 +42,11 @@ if(ENABLE_ALL_THE_DEBUG_MACROS)
include(all_the_debug_macros)
endif()
# FIXME: Is it worth inventing `serenity_dependent_option` ?
if (ENABLE_LAGOM_LADYBIRD)
set(ENABLE_LAGOM_LIBWEB ON CACHE BOOL "" FORCE)
endif()
# FIXME: BUILD_SHARED_LIBS has a default of OFF, as it's intended to be set by the
# user when configuring the project. We should instead change libjs-test262
# and oss-fuzz to set this option on their end, and enable it by default in
@ -115,6 +120,13 @@ if (ENABLE_FUZZERS)
add_compile_options(-fno-omit-frame-pointer)
endif()
if (ENABLE_LAGOM_LADYBIRD AND (ENABLE_FUZZERS OR ENABLE_COMPILER_EXPLORER_BUILD))
message(FATAL_ERROR
"Ladybird build not supported for Fuzzers or Compiler Explorer."
"Disable ENABLE_LAGOM_LADYBIRD and try again."
)
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang$")
# Clang's default constexpr-steps limit is 1048576(2^20), GCC doesn't have one
add_compile_options(-Wno-overloaded-virtual -Wno-user-defined-literals -fconstexpr-steps=16777216)
@ -441,6 +453,10 @@ if (BUILD_LAGOM)
add_serenity_subdirectory(Userland/Shell)
if (ENABLE_LAGOM_LADYBIRD)
add_serenity_subdirectory(Ladybird)
endif()
if (NOT ENABLE_FUZZERS AND NOT ENABLE_COMPILER_EXPLORER_BUILD AND NOT ANDROID)
# Lagom Services
add_serenity_subdirectory(Userland/Services)