Skip to content

Commit

Permalink
Azure CI: Bundle ninja too (current master)
Browse files Browse the repository at this point in the history
Primarily for a deterministic and predictable build order:
ninja-build/ninja#1866

That PR hasn't landed in any official release yet.
  • Loading branch information
kinke committed Mar 21, 2022
1 parent 35ba77e commit 4e471d7
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .azure-pipelines/6-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,44 @@ steps:
fi
displayName: Build & copy reggae

# Symmetry: bundle ninja too
- bash: |
set -ex
cd ..
git clone --recursive https://github.com/ninja-build/ninja.git ninja-src
cd ninja-src
git checkout "$(cat $BUILD_SOURCESDIRECTORY/packaging/ninja_version)"
displayName: Clone ninja
- bash: |
set -ex
cd ..
export PATH="$PWD/ninja:$PATH" # for macOS
cd ninja-src
extraFlags=($EXTRA_CMAKE_FLAGS_CROSS ${EXTRA_CMAKE_FLAGS_ANDROID:-})
[[ "$CI_OS" == "linux" ]] && extraFlags+=(-DCMAKE_EXE_LINKER_FLAGS=-static-libstdc++)
cmake -G Ninja -Bbuild -DCMAKE_BUILD_TYPE=Release "${extraFlags[@]}"
cmake --build build
cp build/ninja ../installed/bin
if [[ "$EXTRA_CMAKE_FLAGS_CROSS" == "" ]]; then
../installed/bin/ninja --version
fi
# note: compile errors on Android
displayName: Build & copy ninja (Linux/Mac)
condition: and(succeeded(), in(variables['CI_OS'], 'linux', 'osx'))
- script: |
echo on
cd ..
call "%LDC_VSDIR%\Common7\Tools\VsDevCmd.bat" -arch=%ARCH% || exit /b
echo on
set PATH=%CD%\ninja;%PATH%
cd ninja-src || exit /b
cmake -G Ninja -Bbuild -DCMAKE_BUILD_TYPE=Release || exit /b
cmake --build build || exit /b
copy build\ninja.exe ..\installed\bin || exit /b
..\installed\bin\ninja.exe --version || exit /b
displayName: Build & copy ninja (Windows)
condition: and(succeeded(), eq(variables['CI_OS'], 'windows'))

# Symmetry: add default switches `-fvisibility=hidden -link-defaultlib-shared -link-internally`
- powershell: |
cd ..\installed
Expand Down
1 change: 1 addition & 0 deletions packaging/ninja_version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1463b1fc3135358ebb19d29448e99ef62e5f1ee6

0 comments on commit 4e471d7

Please sign in to comment.