From 26a62dd8d293f61886cada9f57d34b0be05f9daa Mon Sep 17 00:00:00 2001 From: Undefine Date: Sun, 29 Mar 2026 16:13:47 +0200 Subject: [PATCH] Meta: Remove ladybird_option This was just a wrapper around set, which doesn't serve much purpose since the SerenityOS days. --- CMakeLists.txt | 6 ---- Meta/CMake/cmake_options.cmake | 54 +++++++++++++++++----------------- Meta/CMake/gui_framework.cmake | 1 - 3 files changed, 27 insertions(+), 34 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 48ff29b98b..7d9b9799d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,12 +54,6 @@ endif() set(LADYBIRD_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") list(APPEND CMAKE_MODULE_PATH "${LADYBIRD_SOURCE_DIR}/Meta/CMake") -if(NOT COMMAND ladybird_option) - macro(ladybird_option) - set(${ARGV}) - endmacro() -endif() - include(check_for_dependencies) include(gui_framework) include(cmake_options NO_POLICY_SCOPE) diff --git a/Meta/CMake/cmake_options.cmake b/Meta/CMake/cmake_options.cmake index 62e8533599..3b27f78c06 100644 --- a/Meta/CMake/cmake_options.cmake +++ b/Meta/CMake/cmake_options.cmake @@ -1,18 +1,18 @@ -ladybird_option(BUILD_SHARED_LIBS ON CACHE BOOL "Build shared libraries instead of static libraries") +option(BUILD_SHARED_LIBS "Build shared libraries instead of static libraries" ON) -ladybird_option(ENABLE_COMPILETIME_FORMAT_CHECK ON CACHE BOOL "Enable compiletime format string checks") -ladybird_option(ENABLE_UNDEFINED_SANITIZER OFF CACHE BOOL "Enable undefined behavior sanitizer testing in gcc/clang") -ladybird_option(UNDEFINED_BEHAVIOR_IS_FATAL OFF CACHE BOOL "Make undefined behavior sanitizer errors non-recoverable") +option(ENABLE_COMPILETIME_FORMAT_CHECK "Enable compiletime format string checks" ON) +option(ENABLE_UNDEFINED_SANITIZER "Enable undefined behavior sanitizer testing in gcc/clang" OFF) +option(UNDEFINED_BEHAVIOR_IS_FATAL "Make undefined behavior sanitizer errors non-recoverable" OFF) -ladybird_option(ENABLE_ALL_THE_DEBUG_MACROS OFF CACHE BOOL "Enable all debug macros to validate they still compile") +option(ENABLE_ALL_THE_DEBUG_MACROS "Enable all debug macros to validate they still compile" OFF) -ladybird_option(INCLUDE_WASM_SPEC_TESTS OFF CACHE BOOL "Download and include the WebAssembly spec testsuite") +option(INCLUDE_WASM_SPEC_TESTS "Download and include the WebAssembly spec testsuite" OFF) -ladybird_option(LADYBIRD_CACHE_DIR "${PROJECT_BINARY_DIR}/../caches" CACHE PATH "Location of shared cache of downloaded files") -ladybird_option(ENABLE_NETWORK_DOWNLOADS ON CACHE BOOL "Allow downloads of required files. If OFF, required files must already be present in LADYBIRD_CACHE_DIR") +set(LADYBIRD_CACHE_DIR "${PROJECT_BINARY_DIR}/../caches" CACHE PATH "Location of shared cache of downloaded files") +option(ENABLE_NETWORK_DOWNLOADS "Allow downloads of required files. If OFF, required files must already be present in LADYBIRD_CACHE_DIR" ON) -ladybird_option(ENABLE_CLANG_PLUGINS OFF CACHE BOOL "Enable building with the Clang plugins") -ladybird_option(ENABLE_CLANG_PLUGINS_INVALID_FUNCTION_MEMBERS OFF CACHE BOOL "Enable detecting invalid function types as members of GC-allocated objects") +option(ENABLE_CLANG_PLUGINS "Enable building with the Clang plugins" OFF) +option(ENABLE_CLANG_PLUGINS_INVALID_FUNCTION_MEMBERS "Enable detecting invalid function types as members of GC-allocated objects" OFF) if ((LINUX AND NOT ANDROID) OR BSD) set(freedesktop_files_default ON) @@ -20,12 +20,12 @@ else() set(freedesktop_files_default OFF) endif() -ladybird_option(ENABLE_GUI_TARGETS ON CACHE BOOL "Enable building GUI targets") -ladybird_option(ENABLE_INSTALL_HEADERS ON CACHE BOOL "Enable installing headers") -ladybird_option(ENABLE_INSTALL_FREEDESKTOP_FILES ${freedesktop_files_default} CACHE BOOL "Enable installing .desktop and .service files") -ladybird_option(LADYBIRD_ENABLE_CPPTRACE ON CACHE BOOL "Enable use of cpptrace as the default library for stacktraces. If not available falls back to backtrace.h") -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") +option(ENABLE_GUI_TARGETS "Enable building GUI targets" ON) +option(ENABLE_INSTALL_HEADERS "Enable installing headers" ON) +option(ENABLE_INSTALL_FREEDESKTOP_FILES "Enable installing .desktop and .service files" ${freedesktop_files_default}) +option(LADYBIRD_ENABLE_CPPTRACE "Enable use of cpptrace as the default library for stacktraces. If not available falls back to backtrace.h" ON) +option(LADYBIRD_GENERATE_DSYM "Generate dSYM bundles for binaries and libraries (macOS only)" OFF) +option(ENABLE_CI_BASELINE_CPU "Use a baseline CPU target for improved ccache sharing" OFF) # lto1 uses a crazy amount of RAM in static builds. # Disable LTO for static gcc builds unless explicitly asked for. @@ -35,17 +35,17 @@ 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") +option(ENABLE_ADDRESS_SANITIZER "Enable address sanitizer testing in gcc/clang" OFF) +option(ENABLE_MEMORY_SANITIZER "Enable memory sanitizer testing in gcc/clang" OFF) +option(ENABLE_FUZZERS "Build fuzzing targets" OFF) +option(ENABLE_FUZZERS_LIBFUZZER "Build fuzzers using Clang's libFuzzer" OFF) +option(ENABLE_FUZZERS_OSSFUZZ "Build OSS-Fuzz compatible fuzzers" OFF) +option(LAGOM_TOOLS_ONLY "Don't build libraries, utilities and tests, only host build tools" OFF) +option(ENABLE_LAGOM_CCACHE "Enable ccache for Lagom builds" ON) +set(LAGOM_USE_LINKER "" CACHE STRING "The linker to use (e.g. lld, mold) instead of the system default") +set(LAGOM_LINK_POOL_SIZE "" CACHE STRING "The maximum number of parallel jobs to use for linking") +option(ENABLE_LTO_FOR_RELEASE "Enable link-time optimization for release builds" ${RELEASE_LTO_DEFAULT}) +option(ENABLE_LAGOM_COVERAGE_COLLECTION "Enable code coverage instrumentation for lagom binaries in clang" OFF) if (ENABLE_FUZZERS_LIBFUZZER) # With libfuzzer, we need to avoid a duplicate main() linker error giving false negatives diff --git a/Meta/CMake/gui_framework.cmake b/Meta/CMake/gui_framework.cmake index 171c416d47..6c261b92f9 100644 --- a/Meta/CMake/gui_framework.cmake +++ b/Meta/CMake/gui_framework.cmake @@ -9,7 +9,6 @@ else() set(_default_gui "Qt") endif() -# Note: ladybird_option() doesn't play nicely with this variable, so we use set() directly. set(LADYBIRD_GUI_FRAMEWORK ${_default_gui} CACHE STRING "The GUI framework to use for the ladybird application. Possible values: ${_possible_guis}") if (NOT "${LADYBIRD_GUI_FRAMEWORK}" IN_LIST _possible_guis)