Meta: Semi-automatically detect ccache for Lagom builds

The top-level CMakeLists.txt already automatically detects ccache, but
CI will invoke CMake with Lagom's CMakeLists.txt. Add an option to Lagom
to do the same detection.
This commit is contained in:
Timothy Flynn 2021-08-16 22:10:34 -04:00 committed by Linus Groh
parent eedb26110a
commit 831f90c9d4
Notes: sideshowbarker 2024-07-18 05:35:16 +09:00

View file

@ -8,6 +8,7 @@ project(
LANGUAGES C CXX
)
option(ENABLE_LAGOM_CCACHE "Enable ccache for Lagom builds" OFF)
option(BUILD_SHARED_LIBS "Build shared libraries instead of static libraries" ON)
if (ENABLE_OSS_FUZZ)
set(BUILD_SHARED_LIBS OFF) # Don't use shared libraries on oss-fuzz, for ease of integration with their infrastructure
@ -25,6 +26,13 @@ get_filename_component(
find_package(Threads REQUIRED)
if (ENABLE_LAGOM_CCACHE)
find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
endif()
endif()
include(${SERENITY_PROJECT_ROOT}/Meta/CMake/wasm_spec_tests.cmake)
add_compile_options(-Wno-unknown-warning-option -Wno-literal-suffix -Wno-deprecated-copy)