From 2322e8a73dfa9a02f809bb06b4c6d46ab63f67b2 Mon Sep 17 00:00:00 2001 From: Avery King Date: Tue, 26 Nov 2024 09:50:35 -0800 Subject: [PATCH] CMake: Fix usage with ccache Add missing -DCCACHE option to fix builds with ccache. Signed-off-by: Avery King --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b6ff131f1..846f82e12 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -202,12 +202,14 @@ else() message( STATUS "Could NOT find ccache nor sccache, no compiler caching enabled" ) endif() -find_program( SCCACHE_PROGRAM sccache ) -mark_as_advanced( FORCE SCCACHE_PROGRAM ) if(NOT "${SCCACHE_PROGRAM}" STREQUAL "SCCACHE_PROGRAM-NOTFOUND") option(SCCACHE "Use sccache for compiler caching to speed up rebuilds." ON) endif() +if(NOT "${CCACHE_PROGRAM}" STREQUAL "CCACHE_PROGRAM-NOTFOUND") + option(CCACHE "Use ccache for compiler caching to speed up rebuilds." ON) +endif() + # Prefer sccache if both ccache and sccache are found because Windows users may have # ccache installed with MinGW which would not work with MSVC. if(SCCACHE)