Skip to content

Commit

Permalink
GH Actions: Bundle experimental ninja version
Browse files Browse the repository at this point in the history
ninja-build/ninja#2019, rebased onto latest
master (including ninja-build/ninja#1866 for
a deterministic and predictable build order, which hasn't landed in
any official release yet).
  • Loading branch information
kinke committed May 16, 2022
1 parent a8f8d76 commit 1155bf3
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/actions/7-package/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,43 @@ runs:
../installed/bin/reggae --version -b ninja
fi
# Symmetry: bundle ninja too
- name: Clone ninja
shell: bash
run: |
set -eux
cd ..
git clone --recursive https://github.com/symmetryinvestments/ninja.git
cd ninja
git checkout "$(cat ../ldc/packaging/ninja_version)"
- name: Build & copy ninja (Posix)
if: runner.os != 'Windows' && inputs.os != 'android' # compile errors on Android
shell: bash
run: |
set -eux
cd ../ninja
extraFlags="${CROSS_CMAKE_FLAGS:-}"
if [[ '${{ runner.os }}' == Linux && '${{ inputs.os }}' == '' ]]; then
extraFlags+=" -DCMAKE_EXE_LINKER_FLAGS=-static-libstdc++"
fi
cmake -G Ninja -Bbuild -DCMAKE_BUILD_TYPE=Release $extraFlags
cmake --build build
cp build/ninja ../installed/bin/
if [[ '${{ inputs.cross_target_triple }}' == '' ]]; then
../installed/bin/ninja --version
fi
- name: Build & copy ninja (Windows) # needs MSVC env
if: runner.os == 'Windows'
shell: cmd
run: |
call "%LDC_VSDIR%\Common7\Tools\VsDevCmd.bat" -arch=${{ inputs.arch }} || exit /b
echo on
cd ..\ninja || 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 --version || exit /b
- name: 'Symmetry: Add default switches `-fvisibility=hidden -link-defaultlib-shared -link-internally` to Windows ldc2.conf'
if: runner.os == 'Windows'
shell: pwsh
Expand Down
1 change: 1 addition & 0 deletions packaging/ninja_version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
987c97db2084420e5f942655cfdc0984641c282b

0 comments on commit 1155bf3

Please sign in to comment.