Commit e55fc0fb authored by Thibaut ROMAIN's avatar Thibaut ROMAIN
Browse files

ENH: Use buildcache instead of clcache

parent 9c7336db
Pipeline #8623 canceled with stages
in 12 minutes and 20 seconds
...@@ -228,9 +228,9 @@ windows-10-prepare: ...@@ -228,9 +228,9 @@ windows-10-prepare:
- windows10 - windows10
script: script:
- call ./CI/dev_env.bat x64 xdk 10 - call ./CI/dev_env.bat x64 xdk 10
- clcache.exe -s - buildcache.exe -s
- ctest -C Release -V -S CI/prepare_superbuild.cmake - ctest -C Release -V -S CI/prepare_superbuild.cmake
- clcache.exe -s - buildcache.exe -s
windows-10-build: windows-10-build:
extends: .windows-build extends: .windows-build
...@@ -238,9 +238,9 @@ windows-10-build: ...@@ -238,9 +238,9 @@ windows-10-build:
- windows10 - windows10
script: script:
- call ./CI/dev_env.bat x64 otb 10 - call ./CI/dev_env.bat x64 otb 10
- clcache.exe -s - buildcache.exe -s
- ctest -V -S CI/main_superbuild.cmake - ctest -V -S CI/main_superbuild.cmake
- clcache.exe -s - buildcache.exe -s
- ctest -V -S CI/main_packages.cmake - ctest -V -S CI/main_packages.cmake
- move "build_packages\OTB-*.zip" . || dir build_packages - move "build_packages\OTB-*.zip" . || dir build_packages
needs: needs:
......
...@@ -31,6 +31,13 @@ BUILD_EXAMPLES:BOOL=ON ...@@ -31,6 +31,13 @@ BUILD_EXAMPLES:BOOL=ON
BUILD_SHARED_LIBS:BOOL=ON BUILD_SHARED_LIBS:BOOL=ON
BUILD_TESTING:BOOL=ON") BUILD_TESTING:BOOL=ON")
if(WIN32)
set(otb_build_project_option
"${otb_build_project_option}
CMAKE_C_COMPILER_LAUNCHER=buildcache
CMAKE_CXX_COMPILER_LAUNCHER=buildcache")
endif()
set (otb_qa_option set (otb_qa_option
"CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON") "CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON")
......
...@@ -84,25 +84,15 @@ set PATH=%PATH%;C:\tools\GL\%ARCH%\bin ...@@ -84,25 +84,15 @@ set PATH=%PATH%;C:\tools\GL\%ARCH%\bin
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" %ARCH% %TARGET% -vcvars_ver=%VCVER% call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" %ARCH% %TARGET% -vcvars_ver=%VCVER%
:: Setup Clcache :: Setup Clcache
set CLCACHE_DIR=C:\clcache\%PROJECT%-%ARCH%-%TARGET%-%VCVER% set BUILDCACHE_DIR=C:\buildcache\%PROJECT%-%ARCH%-%TARGET%-%VCVER%
set CLCACHE_HARDLINK=1
:: set CLCACHE_SERVER=1
set CLCACHE_CL=
for /F "delims=" %%a in ('where cl.exe') do @if defined CLCACHE_CL (break ) else (set CLCACHE_CL=%%a)
echo CL path: "%CLCACHE_CL%"
:: install clcache.exe as cl.exe
copy C:\tools\Python35-%ARCH%\Scripts\clcache.exe C:\clcache\cl.exe
set PATH=C:\clcache;%PATH%
:: we need to change cache max size: clcache -M <size-in-bytes>
if "%PROJECT%"=="xdk" ( if "%PROJECT%"=="xdk" (
call "clcache.exe" -M 3000000000 set BUILDCACHE_MAX_CACHE_SIZE=3000000000
) )
if "%PROJECT%"=="otb" ( if "%PROJECT%"=="otb" (
call "clcache.exe" -M 2000000000 set BUILDCACHE_MAX_CACHE_SIZE=2000000000
) )
set PATH=C:\tools\buildcache\bin;%PATH%
set IMAGE_NAME=windows-%SHORT_TARGET%-%ARCH%-vc%VCVER% set IMAGE_NAME=windows-%SHORT_TARGET%-%ARCH%-vc%VCVER%
echo Generated IMAGE_NAME: %IMAGE_NAME% echo Generated IMAGE_NAME: %IMAGE_NAME%
......
...@@ -23,6 +23,13 @@ set ( cmake_configure_option ...@@ -23,6 +23,13 @@ set ( cmake_configure_option
"CMAKE_BUILD_TYPE=${CTEST_BUILD_CONFIGURATION} "CMAKE_BUILD_TYPE=${CTEST_BUILD_CONFIGURATION}
CMAKE_INSTALL_PREFIX:PATH=${CTEST_INSTALL_DIRECTORY}") CMAKE_INSTALL_PREFIX:PATH=${CTEST_INSTALL_DIRECTORY}")
if(WIN32)
set (cmake_configure_option
"${cmake_configure_option}
CMAKE_C_COMPILER_LAUNCHER=buildcache
CMAKE_CXX_COMPILER_LAUNCHER=buildcache")
endif()
set ( temporary_option set ( temporary_option
"OTB_USE_MPI=OFF") "OTB_USE_MPI=OFF")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment