Automatically enables ccache if the program is found

This makes it easier to not forget to use this
This commit is contained in:
Ryan Houdek 2020-08-10 19:31:36 +01:00
parent 211aebcfa4
commit b4893b10db

View File

@ -24,6 +24,12 @@ else()
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION FALSE)
endif()
find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
message(STATUS "CCache enabled")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
endif()
if (ENABLE_XRAY)
add_compile_options(-fxray-instrument)
link_libraries(-fxray-instrument)