Skip to content

Commit 1155bf3

Browse files
committed
GH Actions: Bundle experimental ninja version
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).
1 parent a8f8d76 commit 1155bf3

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

.github/actions/7-package/action.yml

+37
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,43 @@ runs:
7979
../installed/bin/reggae --version -b ninja
8080
fi
8181
82+
# Symmetry: bundle ninja too
83+
- name: Clone ninja
84+
shell: bash
85+
run: |
86+
set -eux
87+
cd ..
88+
git clone --recursive https://github.com/symmetryinvestments/ninja.git
89+
cd ninja
90+
git checkout "$(cat ../ldc/packaging/ninja_version)"
91+
- name: Build & copy ninja (Posix)
92+
if: runner.os != 'Windows' && inputs.os != 'android' # compile errors on Android
93+
shell: bash
94+
run: |
95+
set -eux
96+
cd ../ninja
97+
extraFlags="${CROSS_CMAKE_FLAGS:-}"
98+
if [[ '${{ runner.os }}' == Linux && '${{ inputs.os }}' == '' ]]; then
99+
extraFlags+=" -DCMAKE_EXE_LINKER_FLAGS=-static-libstdc++"
100+
fi
101+
cmake -G Ninja -Bbuild -DCMAKE_BUILD_TYPE=Release $extraFlags
102+
cmake --build build
103+
cp build/ninja ../installed/bin/
104+
if [[ '${{ inputs.cross_target_triple }}' == '' ]]; then
105+
../installed/bin/ninja --version
106+
fi
107+
- name: Build & copy ninja (Windows) # needs MSVC env
108+
if: runner.os == 'Windows'
109+
shell: cmd
110+
run: |
111+
call "%LDC_VSDIR%\Common7\Tools\VsDevCmd.bat" -arch=${{ inputs.arch }} || exit /b
112+
echo on
113+
cd ..\ninja || exit /b
114+
cmake -G Ninja -Bbuild -DCMAKE_BUILD_TYPE=Release || exit /b
115+
cmake --build build || exit /b
116+
copy build\ninja.exe ..\installed\bin\ || exit /b
117+
..\installed\bin\ninja --version || exit /b
118+
82119
- name: 'Symmetry: Add default switches `-fvisibility=hidden -link-defaultlib-shared -link-internally` to Windows ldc2.conf'
83120
if: runner.os == 'Windows'
84121
shell: pwsh

packaging/ninja_version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
987c97db2084420e5f942655cfdc0984641c282b

0 commit comments

Comments
 (0)