summaryrefslogtreecommitdiffstats
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
parent593278332e523644b8bc0104bbc6888329e31c94 (diff)
use sccache on Windows
-rw-r--r--.github/workflows/build.yml13
-rw-r--r--CMakeLists.txt26
2 files changed, 20 insertions, 19 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 14bfc3d7b5..ad706ba286 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -86,8 +86,8 @@ jobs:
# TODO: Fix these broken tests on Windows
ctest_args: --exclude-regex '^AutoDJProcessorTest.*$'
cpack_generator: WIX
- compiler_cache: clcache
- compiler_cache_path: ${{ github.workspace }}\clcache
+ compiler_cache: sccache
+ compiler_cache_path: C:\Users\runneradmin\AppData\Local\Mozilla\sccache\cache
buildenv_basepath: C:\buildenv
buildenv_script: tools/windows_buildenv.bat
artifacts_name: Windows Installer
@@ -117,9 +117,8 @@ jobs:
- name: "[Windows] Install additional build tools"
if: runner.os == 'Windows'
- # TODO: Add ninja, clcache and rsync to the windows buildenv
run: |
- python -m pip install ninja git+https://github.com/frerich/clcache.git
+ choco install sccache ninja
$Env:PATH="C:\msys64\usr\bin;$Env:PATH"
pacman -S --noconfirm coreutils bash rsync openssh
Add-Content -Path "$Env:GITHUB_ENV" -Value "PATH=$Env:PATH"
@@ -182,9 +181,10 @@ jobs:
env:
BUILDENV_BASEPATH: ${{ matrix.buildenv_basepath }}
- - name: "Set compiler cache size limit"
+ - name: "[Ubuntu/macOS] Set compiler cache size limit"
# Set size to 2 GiB
run: ${{ matrix.compiler_cache }} -M 2097152
+ if: runner.os != 'windows'
- name: "Set up compiler cache"
uses: actions/cache@v2
@@ -238,8 +238,7 @@ jobs:
CMAKE_BUILD_PARALLEL_LEVEL: 2
# GitHub Actions automatically zstd compresses caches
CCACHE_NOCOMPRESS: true
- CLCACHE_COMPRESS: false
- CLCACHE_HARDLINK: true
+ SCCACHE_CACHE_SIZE: 2G
- name: "Print compiler cache stats"
run: ${{ matrix.compiler_cache }} -s
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()