summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnder Conselvan de Oliveira <ander.deoliveira@mapbox.com>2018-10-31 14:21:08 +0200
committerAnder Conselvan de Oliveira <ander.deoliveira@mapbox.com>2018-11-01 08:30:02 +0200
commita03425e4d814e5bdd02960ed6b612818deb19130 (patch)
tree71e2b40763eeadf16f8a7139cecadff71a897f56
parent6d8ff823e3c5682f7956106112ac7bfe49612375 (diff)
downloadqtlocation-mapboxgl-upstream/anderco-clcache.tar.gz
[build] Use clcache in appveyor buildupstream/anderco-clcache
clcache is a cache for compiled C and C++ objects similar to ccache but compatible with Microsoft compilers. Using it should result in faster builds.
-rw-r--r--CMakeLists.txt8
-rw-r--r--appveyor.yml13
2 files changed, 19 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 91b0aa5c1c..a48e2c2b01 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -137,6 +137,14 @@ if(CCACHE_PROGRAM)
# Clang also thinks that ccache isn't interactive, so we explicitly need to enable color.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qunused-arguments -fcolor-diagnostics")
endif()
+elseif(WIN32)
+ find_program(CLCACHE_PROGRAM clcache)
+ if(CLCACHE_PROGRAM)
+ # clcache doesn't work with external pdb files
+ # https://github.com/frerich/clcache/issues/30
+ string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
+ string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
+ endif()
else()
message(STATUS "Can't find ccache — consider installing ccache to improve recompilation performance")
endif()
diff --git a/appveyor.yml b/appveyor.yml
index d224661d36..394eb03bde 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -5,6 +5,8 @@ image:
- Visual Studio 2017
environment:
+ PYTHON: C:\python37
+
matrix:
- configuration: Release
@@ -54,6 +56,7 @@ cache:
- '%APPVEYOR_BUILD_FOLDER%\mason_packages'
- '%APPVEYOR_BUILD_FOLDER%\LLVM-%LLVM_VERSION%-win64.exe'
- '%APPVEYOR_BUILD_FOLDER%\cmake-3.10.1-win64-x64.zip'
+ - C:\clcache
install:
- git config --system core.longpaths true
@@ -71,12 +74,16 @@ install:
}
scripts\check-sha256.ps1 LLVM-$env:LLVM_VERSION-win64.exe "$env:LLVM_HASH"
Start-Process -FilePath "LLVM-$env:LLVM_VERSION-win64.exe" -ArgumentList '/S',"/D=C:\LLVM-$env:LLVM_VERSION" -Wait
+ - set PATH=%PYTHON%\Scripts;%PYTHON%;%PATH%
+ - pip install clcache
before_build:
- set PATH=C:\LLVM-%LLVM_VERSION%\bin;%PATH%
- set PATH=C:\cmake-3.10.1-win64-x64\bin;%PATH%
- - set CC=clang-cl
- - set CXX=clang-cl
+ - set CLCACHE_DIR=c:\clcache
+ - set CLCACHE_CL=clang-cl
+ - set CC=clcache
+ - set CXX=clcache
- mkdir %APPVEYOR_BUILD_FOLDER%\build
- cd %APPVEYOR_BUILD_FOLDER%\build
@@ -91,4 +98,6 @@ build_script:
-DCMAKE_PREFIX_PATH=%QT_PREFIX%
-DCMAKE_MAKE_PROGRAM="%APPVEYOR_BUILD_FOLDER%\platform\qt\ninja.exe"
..
+ - clcache -z
- cmake --build . -- -j %NUMBER_OF_PROCESSORS%
+ - clcache -s