CMake: Enable policy 0157 for more control over Swift compile mode

This commit is contained in:
Andrew Kaster 2024-07-20 08:14:39 -06:00 committed by Andrew Kaster
parent 68ce5f8290
commit 922c6bde87
Notes: github-actions[bot] 2024-07-21 21:56:37 +00:00
2 changed files with 7 additions and 1 deletions

View file

@ -30,8 +30,8 @@ list(APPEND CMAKE_MODULE_PATH "${LADYBIRD_SOURCE_DIR}/Meta/CMake")
include(Ladybird/cmake/EnableLagom.cmake) include(Ladybird/cmake/EnableLagom.cmake)
include(use_linker) include(use_linker)
include(lagom_options NO_POLICY_SCOPE)
include(lagom_compile_options) include(lagom_compile_options)
include(lagom_install_options)
if (ENABLE_ADDRESS_SANITIZER) if (ENABLE_ADDRESS_SANITIZER)
add_cxx_compile_options(-fsanitize=address -fno-omit-frame-pointer) add_cxx_compile_options(-fsanitize=address -fno-omit-frame-pointer)

View file

@ -7,6 +7,12 @@ if (POLICY CMP0116)
cmake_policy(SET CMP0116 NEW) cmake_policy(SET CMP0116 NEW)
endif() endif()
# Enable better flags for configuring swift compilation mode
if (POLICY CMP0157)
cmake_policy(SET CMP0157 NEW)
set(CMAKE_Swift_COMPILATION_MODE "$<IF:$<CONFIG:Release>,wholemodule,incremental>")
endif()
serenity_option(ENABLE_COMPILETIME_FORMAT_CHECK ON CACHE BOOL "Enable compiletime format string checks") serenity_option(ENABLE_COMPILETIME_FORMAT_CHECK ON CACHE BOOL "Enable compiletime format string checks")
serenity_option(ENABLE_UNDEFINED_SANITIZER OFF CACHE BOOL "Enable undefined behavior sanitizer testing in gcc/clang") serenity_option(ENABLE_UNDEFINED_SANITIZER OFF CACHE BOOL "Enable undefined behavior sanitizer testing in gcc/clang")
serenity_option(UNDEFINED_BEHAVIOR_IS_FATAL OFF CACHE BOOL "Make undefined behavior sanitizer errors non-recoverable") serenity_option(UNDEFINED_BEHAVIOR_IS_FATAL OFF CACHE BOOL "Make undefined behavior sanitizer errors non-recoverable")