From 922c6bde8758f02522ed48cdc48f3f85357c4c95 Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Sat, 20 Jul 2024 08:14:39 -0600 Subject: [PATCH] CMake: Enable policy 0157 for more control over Swift compile mode --- CMakeLists.txt | 2 +- Meta/CMake/common_options.cmake | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f0489b8905..7a5e9e43b63 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,8 +30,8 @@ list(APPEND CMAKE_MODULE_PATH "${LADYBIRD_SOURCE_DIR}/Meta/CMake") include(Ladybird/cmake/EnableLagom.cmake) include(use_linker) +include(lagom_options NO_POLICY_SCOPE) include(lagom_compile_options) -include(lagom_install_options) if (ENABLE_ADDRESS_SANITIZER) add_cxx_compile_options(-fsanitize=address -fno-omit-frame-pointer) diff --git a/Meta/CMake/common_options.cmake b/Meta/CMake/common_options.cmake index f0dfde662f3..7584f69f5c6 100644 --- a/Meta/CMake/common_options.cmake +++ b/Meta/CMake/common_options.cmake @@ -7,6 +7,12 @@ if (POLICY CMP0116) cmake_policy(SET CMP0116 NEW) endif() +# Enable better flags for configuring swift compilation mode +if (POLICY CMP0157) + cmake_policy(SET CMP0157 NEW) + set(CMAKE_Swift_COMPILATION_MODE "$,wholemodule,incremental>") +endif() + 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(UNDEFINED_BEHAVIOR_IS_FATAL OFF CACHE BOOL "Make undefined behavior sanitizer errors non-recoverable")