summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2019-10-12 01:26:41 +0200
committerJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2019-10-24 19:12:41 +0200
commitf5c8b12ef283e7a745109f97eba794159be93e2d (patch)
treec8b275e956fbed061e1d0b1e7a92f64dfc628dd3 /CMakeLists.txt
parent43d25fdb7a878330ed20bb5f2615b8529e8d5aac (diff)
CMake: Improve ccache support
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt19
1 files changed, 7 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ad92ba498a..5c994046d0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -81,19 +81,14 @@ find_program(CCACHE_FOUND "ccache")
option(CCACHE_SUPPORT "Enable ccache support" ON)
if(CCACHE_SUPPORT)
if(MSVC)
- message(STATUS "MSVC is not compatible with ccache, support disabled")
- elseif(CCACHE_FOUND)
- if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" # GNU is GNU GCC
- OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
- # without this compiler messages in `make` backend would be uncolored
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=auto")
- endif()
- set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "ccache")
- set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "ccache")
- message(STATUS "ccache found, support enabled")
- else()
- message(STATUS "Could NOT find ccache, support disabled")
+ message(FATAL_ERROR "ccache support is incompatible with MSVC.")
+ elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" # GNU is GNU GCC
+ OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ # without this compiler messages in `make` backend would be uncolored
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=auto")
endif()
+ set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "ccache")
+ set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "ccache")
endif()
configure_file(