From 72da7a668d5e12322c9b3aa909c89fbcff5dfc3d Mon Sep 17 00:00:00 2001 From: Patrick Stewart Date: Wed, 17 Jan 2024 13:18:35 +0000 Subject: [PATCH] cmake: Only use ccache for C++ Setting RULE_LAUNCH_* breaks the build of anything other than C/C++ that ccache doesn't support, e.g. rc.exe on windows. The global property leaks out and breaks any consuming project. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 90ec3d93..091f2b99 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,8 +76,8 @@ find_package(Boost 1.56 COMPONENTS ${immer_boost_components}) find_program(CCACHE ccache) if (CCACHE) message(STATUS "Using ccache: ${CCACHE}") - set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE}) - set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ${CCACHE}) + set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE}) + set(CMAKE_CXX_LINKER_LAUNCHER ${CCACHE}) else() message(STATUS "Could not find ccache") endif()