Add cmake/EnableCcache.cmake and load it from the main file.
Make the standard cmake variables CMAKE_CXX_COMPILER_LAUNCHER and
CMAKE_C_COMPILER_LAUNCHER consistent with each other if either is not
set.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
include(StaticLinkSupport)
include(StandardSettings)
include(StandardWarnings)
+include(EnableCcache)
#
# Configuration
--- /dev/null
+# Make the CMAKE_CXX_COMPILER_LAUNCHER and CMAKE_C_COMPILER_LAUNCHER variables
+# consistent if either is not set.
+
+if(CMAKE_CXX_COMPILER_LAUNCHER AND CMAKE_C_COMPILER_LAUNCHER)
+ return()
+endif()
+
+if(CMAKE_CXX_COMPILER_LAUNCHER AND NOT CMAKE_C_COMPILER_LAUNCHER)
+ set(CMAKE_C_COMPILER_LAUNCHER ${CMAKE_CXX_COMPILER_LAUNCHER})
+elseif(NOT CMAKE_CXX_COMPILER_LAUNCHER AND CMAKE_C_COMPILER_LAUNCHER)
+ set(CMAKE_CXX_COMPILER_LAUNCHER ${CMAKE_C_COMPILER_LAUNCHER})
+endif()