diff --git a/.drone.jsonnet b/.drone.jsonnet index 3fdc464..4cea911 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -2,6 +2,8 @@ # Distributed under the Boost Software License, Version 1.0. # https://www.boost.org/LICENSE_1_0.txt +local library = "system"; + local triggers = { branch: [ "master", "develop", "feature/*" ] @@ -32,7 +34,7 @@ local linux_pipeline(name, image, environment, packages = "", sources = [], arch (if sources != [] then [ ('apt-add-repository "' + source + '"') for source in sources ] else []) + (if packages != "" then [ 'apt-get update', 'apt-get -y install ' + packages ] else []) + [ - 'export SELF=system', + 'export LIBRARY=' + library, './.drone/drone.sh', ] } @@ -62,22 +64,7 @@ local windows_pipeline(name, image, environment, arch = "amd64") = environment: environment, commands: [ - 'set SELF=system', - - 'set DRONE_BUILD_DIR=%CD%', - 'set BOOST_BRANCH=develop', - 'if "%DRONE_BRANCH%" == "master" set BOOST_BRANCH=master', - 'cd ..', - 'git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root', - 'cd boost-root', - 'git submodule update --init tools/boostdep', - 'xcopy /s /e /q %DRONE_BUILD_DIR% libs\\\\%SELF%\\\\', - 'python tools/boostdep/depinst/depinst.py %SELF%', - 'cmd /c bootstrap', - 'b2 -d0 headers', - 'if not "%CXXSTD%" == "" set CXXSTD=cxxstd=%CXXSTD%', - 'if not "%ADDRMD%" == "" set ADDRMD=address-model=%ADDRMD%', - 'b2 -j3 libs/%SELF%/test toolset=%TOOLSET% %CXXSTD% %ADDRMD% variant=debug,release embed-manifest-via=linker', + 'cmd /C .drone\\\\drone.bat ' + library, ] } ] diff --git a/.drone/drone.bat b/.drone/drone.bat index 5e77f2c..66aaf78 100644 --- a/.drone/drone.bat +++ b/.drone/drone.bat @@ -1,24 +1,23 @@ +@REM Copyright 2022 Peter Dimov +@REM Distributed under the Boost Software License, Version 1.0. +@REM https://www.boost.org/LICENSE_1_0.txt + @ECHO ON +set LIBRARY=%1 set DRONE_BUILD_DIR=%CD% -IF "%DRONE_BRANCH%" == "" ( - for /F %%i in ("%GITHUB_REF%") do @set DRONE_BRANCH=%%~nxi -) - -for /F %%i in ("%DRONE_REPO%") do @set SELF=%%~nxi - set BOOST_BRANCH=develop if "%DRONE_BRANCH%" == "master" set BOOST_BRANCH=master cd .. git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root cd boost-root git submodule update --init tools/boostdep -xcopy /s /e /q %DRONE_BUILD_DIR% libs\%SELF%\ -python tools/boostdep/depinst/depinst.py %SELF% +xcopy /s /e /q %DRONE_BUILD_DIR% libs\%LIBRARY%\ +python tools/boostdep/depinst/depinst.py %LIBRARY% cmd /c bootstrap b2 -d0 headers if not "%CXXSTD%" == "" set CXXSTD=cxxstd=%CXXSTD% if not "%ADDRMD%" == "" set ADDRMD=address-model=%ADDRMD% -b2 -j3 libs/%SELF%/test toolset=%TOOLSET% %CXXSTD% %ADDRMD% variant=debug,release embed-manifest-via=linker +b2 -j3 libs/%LIBRARY%/test toolset=%TOOLSET% %CXXSTD% %ADDRMD% variant=debug,release embed-manifest-via=linker diff --git a/.drone/drone.sh b/.drone/drone.sh index b734b06..586dc69 100755 --- a/.drone/drone.sh +++ b/.drone/drone.sh @@ -15,10 +15,10 @@ cd .. git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root cd boost-root git submodule update --init tools/boostdep -cp -r $DRONE_BUILD_DIR/* libs/$SELF -python tools/boostdep/depinst/depinst.py $SELF +cp -r $DRONE_BUILD_DIR/* libs/$LIBRARY +python tools/boostdep/depinst/depinst.py $LIBRARY ./bootstrap.sh ./b2 -d0 headers echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam -./b2 -j3 libs/$SELF/test toolset=$TOOLSET cxxstd=$CXXSTD variant=debug,release ${ADDRMD:+address-model=$ADDRMD} ${UBSAN:+cxxflags=-fsanitize=undefined cxxflags=-fno-sanitize-recover=undefined linkflags=-fsanitize=undefined define=UBSAN=1 debug-symbols=on} ${LINKFLAGS:+linkflags=$LINKFLAGS} +./b2 -j3 libs/$LIBRARY/test toolset=$TOOLSET cxxstd=$CXXSTD variant=debug,release ${ADDRMD:+address-model=$ADDRMD} ${UBSAN:+cxxflags=-fsanitize=undefined cxxflags=-fno-sanitize-recover=undefined linkflags=-fsanitize=undefined define=UBSAN=1 debug-symbols=on} ${LINKFLAGS:+linkflags=$LINKFLAGS}