summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Kaster <akaster@serenityos.org>2022-12-23 11:36:45 -0700
committerAndrew Kaster <andrewdkaster@gmail.com>2022-12-25 07:58:58 -0700
commit0384513779613b04f55ef305514d7624681aab5d (patch)
treea131ecafc63a46e3f98bed1cd9e95462db936a52
parentb4d80f92eccf5bbb08805b1b453fd61153a3d2a5 (diff)
downloadserenity-0384513779613b04f55ef305514d7624681aab5d.zip
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.
-rw-r--r--Meta/CMake/lagom_options.cmake1
-rw-r--r--Meta/Lagom/CMakeLists.txt16
2 files changed, 17 insertions, 0 deletions
diff --git a/Meta/CMake/lagom_options.cmake b/Meta/CMake/lagom_options.cmake
index 7789ca234d..c37d889d38 100644
--- a/Meta/CMake/lagom_options.cmake
+++ b/Meta/CMake/lagom_options.cmake
@@ -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")
diff --git a/Meta/Lagom/CMakeLists.txt b/Meta/Lagom/CMakeLists.txt
index 2e8dd8d46e..dbf2aefed2 100644
--- a/Meta/Lagom/CMakeLists.txt
+++ b/Meta/Lagom/CMakeLists.txt
@@ -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)