mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
Meta: Move all CMake options to a one unified file
Just another step of removing the split between lagom and common.
This commit is contained in:
Notes:
github-actions[bot]
2026-03-29 20:01:19 +00:00
Author: https://github.com/cqundefine Commit: https://github.com/LadybirdBrowser/ladybird/commit/539f4d0c9b1 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8650 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/spholz
@@ -40,7 +40,7 @@ set(LADYBIRD_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
list(APPEND CMAKE_MODULE_PATH "${LADYBIRD_SOURCE_DIR}/Meta/CMake")
|
||||
|
||||
include(UI/cmake/EnableLagom.cmake)
|
||||
include(lagom_options NO_POLICY_SCOPE)
|
||||
include(cmake_options NO_POLICY_SCOPE)
|
||||
include(compile_options)
|
||||
|
||||
# We need to find OpenSSL in order to link it explicitly with all targets.
|
||||
|
||||
@@ -27,6 +27,26 @@ ladybird_option(LADYBIRD_ENABLE_CPPTRACE ON CACHE BOOL "Enable use of cpptrace a
|
||||
ladybird_option(LADYBIRD_GENERATE_DSYM OFF CACHE BOOL "Generate dSYM bundles for binaries and libraries (macOS only)")
|
||||
ladybird_option(ENABLE_CI_BASELINE_CPU OFF CACHE BOOL "Use a baseline CPU target for improved ccache sharing")
|
||||
|
||||
# lto1 uses a crazy amount of RAM in static builds.
|
||||
# Disable LTO for static gcc builds unless explicitly asked for.
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT BUILD_SHARED_LIBS)
|
||||
set(RELEASE_LTO_DEFAULT OFF)
|
||||
else()
|
||||
set(RELEASE_LTO_DEFAULT ON)
|
||||
endif()
|
||||
|
||||
ladybird_option(ENABLE_ADDRESS_SANITIZER OFF CACHE BOOL "Enable address sanitizer testing in gcc/clang")
|
||||
ladybird_option(ENABLE_MEMORY_SANITIZER OFF CACHE BOOL "Enable memory sanitizer testing in gcc/clang")
|
||||
ladybird_option(ENABLE_FUZZERS OFF CACHE BOOL "Build fuzzing targets")
|
||||
ladybird_option(ENABLE_FUZZERS_LIBFUZZER OFF CACHE BOOL "Build fuzzers using Clang's libFuzzer")
|
||||
ladybird_option(ENABLE_FUZZERS_OSSFUZZ OFF CACHE BOOL "Build OSS-Fuzz compatible fuzzers")
|
||||
ladybird_option(LAGOM_TOOLS_ONLY OFF CACHE BOOL "Don't build libraries, utilities and tests, only host build tools")
|
||||
ladybird_option(ENABLE_LAGOM_CCACHE ON CACHE BOOL "Enable ccache for Lagom builds")
|
||||
ladybird_option(LAGOM_USE_LINKER "" CACHE STRING "The linker to use (e.g. lld, mold) instead of the system default")
|
||||
ladybird_option(LAGOM_LINK_POOL_SIZE "" CACHE STRING "The maximum number of parallel jobs to use for linking")
|
||||
ladybird_option(ENABLE_LTO_FOR_RELEASE ${RELEASE_LTO_DEFAULT} CACHE BOOL "Enable link-time optimization for release builds")
|
||||
ladybird_option(ENABLE_LAGOM_COVERAGE_COLLECTION OFF CACHE STRING "Enable code coverage instrumentation for lagom binaries in clang")
|
||||
|
||||
ladybird_option(ENABLE_RUST ON CACHE BOOL "Build Rust components")
|
||||
|
||||
if (ENABLE_FUZZERS_LIBFUZZER)
|
||||
@@ -53,3 +73,5 @@ check_cxx_source_compiles([=[
|
||||
]=] CXX_COMPILER_SUPPORTS_OBJC_ARC)
|
||||
unset(CMAKE_REQUIRED_FLAGS)
|
||||
unset(CMAKE_REQUIRED_LIBRARIES)
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/lagom_install_options.cmake)
|
||||
@@ -1,26 +0,0 @@
|
||||
#
|
||||
# Options specific to the Lagom (host) build
|
||||
#
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/common_options.cmake NO_POLICY_SCOPE)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/lagom_install_options.cmake)
|
||||
|
||||
# lto1 uses a crazy amount of RAM in static builds.
|
||||
# Disable LTO for static gcc builds unless explicitly asked for.
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT BUILD_SHARED_LIBS)
|
||||
set(RELEASE_LTO_DEFAULT OFF)
|
||||
else()
|
||||
set(RELEASE_LTO_DEFAULT ON)
|
||||
endif()
|
||||
|
||||
ladybird_option(ENABLE_ADDRESS_SANITIZER OFF CACHE BOOL "Enable address sanitizer testing in gcc/clang")
|
||||
ladybird_option(ENABLE_MEMORY_SANITIZER OFF CACHE BOOL "Enable memory sanitizer testing in gcc/clang")
|
||||
ladybird_option(ENABLE_FUZZERS OFF CACHE BOOL "Build fuzzing targets")
|
||||
ladybird_option(ENABLE_FUZZERS_LIBFUZZER OFF CACHE BOOL "Build fuzzers using Clang's libFuzzer")
|
||||
ladybird_option(ENABLE_FUZZERS_OSSFUZZ OFF CACHE BOOL "Build OSS-Fuzz compatible fuzzers")
|
||||
ladybird_option(LAGOM_TOOLS_ONLY OFF CACHE BOOL "Don't build libraries, utilities and tests, only host build tools")
|
||||
ladybird_option(ENABLE_LAGOM_CCACHE ON CACHE BOOL "Enable ccache for Lagom builds")
|
||||
ladybird_option(LAGOM_USE_LINKER "" CACHE STRING "The linker to use (e.g. lld, mold) instead of the system default")
|
||||
ladybird_option(LAGOM_LINK_POOL_SIZE "" CACHE STRING "The maximum number of parallel jobs to use for linking")
|
||||
ladybird_option(ENABLE_LTO_FOR_RELEASE ${RELEASE_LTO_DEFAULT} CACHE BOOL "Enable link-time optimization for release builds")
|
||||
ladybird_option(ENABLE_LAGOM_COVERAGE_COLLECTION OFF CACHE STRING "Enable code coverage instrumentation for lagom binaries in clang")
|
||||
@@ -41,7 +41,7 @@ endif()
|
||||
include(check_for_dependencies)
|
||||
include(use_linker)
|
||||
include(gui_framework)
|
||||
include(lagom_options NO_POLICY_SCOPE)
|
||||
include(cmake_options NO_POLICY_SCOPE)
|
||||
|
||||
if(ENABLE_ALL_THE_DEBUG_MACROS)
|
||||
include(all_the_debug_macros)
|
||||
|
||||
Reference in New Issue
Block a user