CMake: modernize to use CMAKE_<LANG>_COMPILER_LAUNCHER for ccache.

This commit is contained in:
Jacob Oursland
2024-11-27 18:32:25 -08:00
committed by Chris Hennes
parent 46dfa2e39b
commit 7df1a5d00a

View File

@@ -21,8 +21,9 @@ option(FREECAD_USE_CCACHE "Auto detect and use ccache during compilation" ON)
if(FREECAD_USE_CCACHE)
find_program(CCACHE_PROGRAM ccache) #This check should occur before project()
if(CCACHE_PROGRAM)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
message(NOTICE "-- Using ccache found at: " ${CCACHE_PROGRAM})
message(STATUS "Using ccache found at: " ${CCACHE_PROGRAM})
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
endif()
endif()