summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorBe <be@mixxx.org>2021-02-05 14:56:01 -0600
committerBe <be@mixxx.org>2021-02-26 03:30:56 -0600
commitca23266ab11a2ba10f3d9824ca4e0d33affd5316 (patch)
treee43a4cae0f8341c841a6757efc986da6f0f8692e /CMakeLists.txt
parent593278332e523644b8bc0104bbc6888329e31c94 (diff)
use sccache on Windows
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt26
1 files changed, 14 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ddb80f7e2d..e552e9b32a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -331,19 +331,18 @@ if(GIT_WORKTREE_DIRTY EQUAL "1")
endif()
message(STATUS "Git commit count: ${GIT_COMMIT_COUNT}")
if(MSVC)
- # clcache support
- find_program(CLCACHE_EXECUTABLE "clcache")
- if(CLCACHE_EXECUTABLE)
- message(STATUS "Found clcache: ${CLCACHE_EXECUTABLE}")
+ # sccache support
+ find_program(SCCACHE_EXECUTABLE "sccache")
+ if(SCCACHE_EXECUTABLE)
+ message(STATUS "Found sccache: ${SCCACHE_EXECUTABLE}")
else()
- message(STATUS "Could NOT find clcache (missing executable)")
+ message(STATUS "Could NOT find sccache (missing executable)")
endif()
- cmake_dependent_option(CLCACHE_SUPPORT "Enable clcache support" ON "CLCACHE_EXECUTABLE" OFF)
- if(CLCACHE_SUPPORT)
- set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "clcache")
- set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "clcache")
+ cmake_dependent_option(SCCACHE_SUPPORT "Enable sccache support" ON "SCCACHE_EXECUTABLE" OFF)
+ message(STATUS "Support for sccache: ${SCCACHE_SUPPORT}")
+ if(SCCACHE_SUPPORT)
+ set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "sccache")
endif()
- message(STATUS "Support for clcache: ${CLCACHE_SUPPORT}")
else()
# ccache support
find_program(CCACHE_EXECUTABLE "ccache")
@@ -1121,8 +1120,6 @@ if(WIN32)
target_link_libraries(mixxx-lib PUBLIC shell32)
if(MSVC)
- # needed for clcache
- target_compile_options(mixxx-lib PUBLIC /c)
if(NOT STATIC_DEPS OR CMAKE_BUILD_TYPE STREQUAL "Debug")
target_link_options(mixxx-lib PUBLIC /nodefaultlib:LIBCMT.lib /nodefaultlib:LIBCMTd.lib)
endif()
@@ -1629,6 +1626,11 @@ if(WIN32)
src/mixxx.rc
"${CMAKE_CURRENT_BINARY_DIR}/src/mixxx.rc.include"
)
+ # sccache fails with RC files
+ # https://github.com/mozilla/sccache/issues/947
+ if(SCCACHE_SUPPORT)
+ set_target_properties(mixxx PROPERTIES RULE_LAUNCH_COMPILE "")
+ endif()
target_include_directories(mixxx PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}")
endif()