diff options
author | Ander Conselvan de Oliveira <ander.deoliveira@mapbox.com> | 2018-10-31 14:21:08 +0200 |
---|---|---|
committer | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2018-11-01 13:49:15 +0200 |
commit | ca21cedb849e1b6a0071f62bb7139ea7ebbda6d0 (patch) | |
tree | 71e2b40763eeadf16f8a7139cecadff71a897f56 | |
parent | 98e12c721ed65e942e57e14114ec379f053eeac4 (diff) | |
download | qtlocation-mapboxgl-ca21cedb849e1b6a0071f62bb7139ea7ebbda6d0.tar.gz |
[build] Use clcache in appveyor build
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.txt | 8 | ||||
-rw-r--r-- | appveyor.yml | 13 |
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 |