Setup sccache

This commit is contained in:
Romain Thomas 2020-12-12 08:31:52 +01:00
parent 1fecc1b147
commit 623055b045
2 changed files with 29 additions and 5 deletions

View File

@ -13,6 +13,9 @@ environment:
secure: TT7SXISIifq2/tf02n2ATgPj+Ky4Cjl3Fg44BAfyI4yRa4i87UAQIx5EFeV63+Xv2rhcU7JcMgl+An7QBrV6ofuQ9jxbuw+Gd1GqcCrAIyY=
LIEF_AUTOMATIC_BUILDS_IV:
secure: /S6Vbt3vEisoC81siFbkqOXQeVnwxLZZPMYp1r79G7h+HFjLlWUZSidxxpsAgHNE
SCCACHE_CACHE_SIZE: "250M"
SCCACHE_DIR: C:\Users\appveyor\AppData\Local\Mozilla\sccache
SCCACHE_ERROR_LOG: C:\projects\sccache.log
matrix:
# Python 3.6
- PYTHON_VERSION: "3.6"
@ -58,7 +61,12 @@ environment:
PYTHON64_BINARY: "C:\\Python39-x64\\python.exe"
PYTHON64_LIBRARY: "C:\\Python39-x64\\libs\\python39.lib"
cache:
- '%SCCACHE_DIR%'
install:
- cmd: choco install sccache
- cmd: sccache.exe --start-server
- ps: if ($env:PLATFORM -eq "x64") { $env:CMAKE_ARCH = "x64" }
- ps: if ($env:PLATFORM -eq "x64") { $env:PYTHON_PATH = $env:PYTHON64_PATH }
@ -88,6 +96,9 @@ after_build:
- ps: Start-Service -Name 'ssh-agent'
- bash ./.github/deploy.sh
on_finish:
- cmd: sccache.exe --stop-server
artifacts:
- path: 'dist\*.whl'
name: python-wheel

View File

@ -41,11 +41,24 @@ include(LIEFCompilerDetection)
# CCACHE
# ======
find_program(CCACHE_FOUND ccache)
message(STATUS "ccache: ${LIEF_USE_CCACHE}")
if(CCACHE_FOUND AND LIEF_USE_CCACHE)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
message(STATUS "Caching: ${LIEF_USE_CCACHE}")
if(LIEF_USE_CCACHE)
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
message(STATUS "Found ccache: ${CCACHE_FOUND}")
else()
find_program(SCCACHE_FOUND sccache)
if (SCCACHE_FOUND)
set(CMAKE_C_COMPILER_LAUNCHER ${SCCACHE_FOUND})
set(CMAKE_CXX_COMPILER_LAUNCHER ${SCCACHE_FOUND})
message(STATUS "Found sccache: ${SCCACHE_FOUND}")
else()
set(LIEF_USE_CCACHE OFF)
message(WARNING "Can't find cache solution")
endif()
endif()
endif()
# Dependencies