spirit/.appveyor.yml
2019-09-30 01:29:29 +03:00

123 lines
5.1 KiB
YAML

clone_depth: 50
environment:
global:
PROJECT: libs\spirit
TEST_LINK_DEPS: date_time,filesystem,regex,thread
APPVEYOR_SAVE_CACHE_ON_ERROR: true
CLCACHE_HARDLINK: 1
APPVEYOR_CACHE_ENTRY_ZIP_ARGS: "-t7z -m0=lzma2 -mx=3 -md=32m -ms=on"
CLCACHE_CACHESIZE: 2123123123 # Appveyor allows us to store 1Gb of 7zipped cache but
# object files compress ratio is 20:1 in our case
matrix:
- { APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017', ADDRMDL: 64, TOOLSET: 'msvc-14.1' }
- { APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015', ADDRMDL: 64, TOOLSET: 'msvc-14.0' }
- { APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015', ADDRMDL: 64, TOOLSET: 'msvc-12.0' }
- { APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015', ADDRMDL: 32, TOOLSET: 'msvc-11.0' }
- { APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015', ADDRMDL: 32, TOOLSET: 'msvc-10.0' }
cache:
- '%USERPROFILE%\clcache'
- '%LOCALAPPDATA%\pip\Cache'
init:
- set BOOST_ROOT=%APPVEYOR_BUILD_FOLDER%\..\boost
- set BOOST_BUILD_PATH=%BOOST_ROOT%\..\boost-build
- set B2_ARGS=-j%NUMBER_OF_PROCESSORS% link=shared threading=multi
variant=release address-model=%ADDRMDL% toolset=%TOOLSET%
define=BOOST_ALL_NO_LIB
before_build:
- set PATH=%BOOST_ROOT%;C:\Python36-x64\Scripts;%PATH%
- ps: |
# Creating %USERPROFILE%/user-config.jam file
@'
import feature os regex toolset pch ;
# clcache
local toolset = [ regex.split [ os.environ TOOLSET ] "-" ] ;
using $(toolset[1]) : $(toolset[2-]:J="-") : : <compiler>clcache ;
# Ignore some warnings
feature.feature known-warnings : suppress : optional incidental propagated ;
toolset.flags msvc.compile OPTIONS <known-warnings>suppress :
-wd4244 # lit1.cpp(31): wchar_t to char truncation
-wd4996 # Call to 'std::copy' with parameters that may be unsafe
-wd4003 # Fusion adapt_adt: not enough actual parameters for macro
-wd4100 # unreferenced formal parameter
-wd4310 # cast truncates constant value
-wd4456 # declaration of 'varname' hides previous local declaration
-wd4457 # declaration of 'varname' hides function parameter
-wd4458 # declaration of 'varname' hides class member
-wd4459 # declaration of 'varname' hides global declaration
-wd4512 # assignment operator could not be generated
-wd4702 # unreachable code
-wd4701 # potentially uninitialized local variable 'varname' used
-wd4709 # msvc bug https://stackoverflow.com/questions/6012068
-wd4714 # function 'x' marked as __forceinline not inlined
: unchecked ;
# A subfeature that tells Spirit tests to use PCH
feature.subfeature pch on : version : spirit : optional propagated incidental ;
'@ | sc "$env:USERPROFILE/user-config.jam"
- set BRANCH=%APPVEYOR_REPO_BRANCH%
# TODO: Determine the root branch when PR targeted/build from not our main branches.
- if not "%BRANCH%" == "master"
if not "%BRANCH%" == "develop"
set BRANCH=develop
- echo Root branch is %BRANCH%
# Sadly git's --shallow-submodules has hardcoded depth of 1 commit
# Patch the git binary with a little more depth to deal with boost-commitbot's lag
- ps: |
$git = Get-Command git | Select-Object -ExpandProperty Definition
$git = Split-Path -Parent $git | Split-Path -Parent
Get-ChildItem -Path "$git\mingw64\*" -Include *.exe -Recurse |
ForEach-Object -Process {(Get-Content -Raw $_).Replace("--depth=1","--depth=9") | Set-Content $_}
# Checkout Boost
- git clone -j10 --branch=%BRANCH% --depth=1 --quiet
--recurse-submodules=":(exclude)%PROJECT%" --shallow-submodules
https://github.com/boostorg/boost.git %BOOST_ROOT%
- pushd %BOOST_ROOT%
# Remove empty folder
- rmdir /S /Q %PROJECT%
# Move the repository to boost/libs and make a link to previous place
- move %APPVEYOR_BUILD_FOLDER% %PROJECT%
- mklink /J %APPVEYOR_BUILD_FOLDER% %PROJECT%
# Install clcache
- pip install clcache
- clcache -M %CLCACHE_CACHESIZE%
# Run clcache-server
- set CLCACHE_SERVER=1
- ps: Start-Process clcache-server.exe -PassThru
build_script:
- bootstrap.bat --with-toolset=msvc
|| ( echo === bootstrap.log === && cat bootstrap.log )
# bootstrap.bat does not support --with-libraries
- echo libraries = >> project-config.jam
- for %%a in ("%TEST_LINK_DEPS:,=" "%") do (
echo --with-%%~a >> project-config.jam
)
- echo ; >> project-config.jam
# Let's have less noise (Appveyor cannot collapse command output)
- b2 headers 2>&1 >> deps_build.log &&
b2 %B2_ARGS% warnings=off 2>&1 >> deps_build.log
|| ( echo === deps_build.log === && cat deps_build.log )
test_script:
- set B2_ARGS=%B2_ARGS% warnings=extra known-warnings=suppress warnings-as-errors=on
- echo B2 argumets %B2_ARGS%
- b2 %B2_ARGS% pch=on-spirit %PROJECT%\classic\test
- b2 %B2_ARGS% pch=on-spirit %PROJECT%\repository\test
- b2 %B2_ARGS% pch=on-spirit %PROJECT%\test