Skip to content

Commit

Permalink
cmake: Only use ccache for C++
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
patstew committed Jan 17, 2024
1 parent 5875f77 commit 72da7a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 72da7a6

Please sign in to comment.