Commit 73ed482d authored by Cédric Traizet's avatar Cédric Traizet
Browse files

Merge branch 'replace-clcache-buildcache' into 'develop'

Use buildcache instead of clcache

See merge request !855
parents 9c7336db f932de74
Pipeline #8634 passed with stages
in 4 minutes and 29 seconds
......@@ -228,9 +228,9 @@ windows-10-prepare:
- windows10
script:
- call ./CI/dev_env.bat x64 xdk 10
- clcache.exe -s
- buildcache.exe -s
- ctest -C Release -V -S CI/prepare_superbuild.cmake
- clcache.exe -s
- buildcache.exe -s
windows-10-build:
extends: .windows-build
......@@ -238,9 +238,9 @@ windows-10-build:
- windows10
script:
- call ./CI/dev_env.bat x64 otb 10
- clcache.exe -s
- buildcache.exe -s
- ctest -V -S CI/main_superbuild.cmake
- clcache.exe -s
- buildcache.exe -s
- ctest -V -S CI/main_packages.cmake
- move "build_packages\OTB-*.zip" . || dir build_packages
needs:
......
......@@ -31,6 +31,13 @@ BUILD_EXAMPLES:BOOL=ON
BUILD_SHARED_LIBS: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
"CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON")
......
......@@ -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%
:: Setup Clcache
set CLCACHE_DIR=C:\clcache\%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)
set BUILDCACHE_DIR=C:\buildcache\%PROJECT%-%ARCH%-%TARGET%-%VCVER%
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" (
call "clcache.exe" -M 3000000000
set BUILDCACHE_MAX_CACHE_SIZE=3000000000
)
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%
echo Generated IMAGE_NAME: %IMAGE_NAME%
......
......@@ -23,6 +23,13 @@ set ( cmake_configure_option
"CMAKE_BUILD_TYPE=${CTEST_BUILD_CONFIGURATION}
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
"OTB_USE_MPI=OFF")
......
......@@ -22,7 +22,11 @@ find_package(GLEW REQUIRED)
# FIX: glew-config.cmake import GLEW::GLEW target but does not necessarily set GLEW_LIBRARY
if(NOT GLEW_LIBRARY)
get_target_property(GLEW_LIBRARY GLEW::GLEW IMPORTED_LOCATION_RELEASE)
if(WIN32)
get_target_property(GLEW_LIBRARY GLEW::GLEW IMPORTED_IMPLIB_RELEASE)
else()
get_target_property(GLEW_LIBRARY GLEW::GLEW IMPORTED_LOCATION_RELEASE)
endif()
endif()
mark_as_advanced(GLEW_INCLUDE_DIR)
......
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