From 7874531ea9c54dd42d00e77195fdb811aa6b8f0c Mon Sep 17 00:00:00 2001 From: Michael Jones Date: Tue, 7 Apr 2020 18:17:46 -0500 Subject: [PATCH] CMakeLists should not know anything about ccache --- benchmarks/CMakeLists.txt | 7 ------- examples/CMakeLists.txt | 7 ------- scripts/build.sh | 4 ++++ tests/CMakeLists.txt | 7 ------- 4 files changed, 4 insertions(+), 21 deletions(-) diff --git a/benchmarks/CMakeLists.txt b/benchmarks/CMakeLists.txt index f21e681f7..be2439db5 100644 --- a/benchmarks/CMakeLists.txt +++ b/benchmarks/CMakeLists.txt @@ -1,10 +1,3 @@ -find_program(CCACHE_FOUND ccache) - -if(CCACHE_FOUND) - set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) - set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) -endif() - add_executable(ozo_benchmark ozo_benchmark.cpp) target_link_libraries(ozo_benchmark ozo) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index c5c2fdb3f..465eea6e3 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,10 +1,3 @@ -find_program(CCACHE_FOUND ccache) - -if(CCACHE_FOUND) - set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) - set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) -endif() - add_executable(ozo_request request.cpp) target_link_libraries(ozo_request ozo) diff --git a/scripts/build.sh b/scripts/build.sh index 667bfad87..653a19cd0 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -112,6 +112,8 @@ build() { mkdir -p ${BUILD_DIR} cd ${BUILD_DIR} cmake \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DCMAKE_C_COMPILER="${CC_COMPILER}" \ -DCMAKE_CXX_COMPILER="${CXX_COMPILER}" \ -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS"\ @@ -148,6 +150,8 @@ build() { mkdir -p ${EXT_BUILD_DIR} cd ${EXT_BUILD_DIR} cmake \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DCMAKE_C_COMPILER="${CC_COMPILER}" \ -DCMAKE_CXX_COMPILER="${CXX_COMPILER}" \ -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \ diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 3141832ce..3eaa619fd 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,5 +1,3 @@ -find_program(CCACHE_FOUND ccache) - include(ExternalProject) ExternalProject_Add( GoogleTest @@ -83,11 +81,6 @@ target_link_libraries(ozo_tests gmock) target_link_libraries(ozo_tests ozo) add_test(ozo_tests ozo_tests) -if(CCACHE_FOUND) - set_target_properties(ozo_tests PROPERTIES RULE_LAUNCH_COMPILE ccache) - set_target_properties(ozo_tests PROPERTIES RULE_LAUNCH_LINK ccache) -endif() - # enable useful warnings and errors target_compile_options(ozo_tests PRIVATE -Wall -Wextra -pedantic -Werror)