Skip to content

Commit 508823a

Browse files
authored
Use Ninja to build llvm in the ci (#423)
1 parent c446c3e commit 508823a

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

.github/workflows/MacOS.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ jobs:
206206
done
207207
brew upgrade openssl >/dev/null 2>&1
208208
brew upgrade
209+
brew install ninja
209210
210211
- name: Build LLVM/Cling if the cache is invalid
211212
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
@@ -238,11 +239,12 @@ jobs:
238239
-DLLVM_ENABLE_ZSTD=OFF \
239240
-DLLVM_ENABLE_TERMINFO=OFF \
240241
-DLLVM_ENABLE_LIBXML2=OFF \
242+
-G Ninja \
241243
../llvm
242-
cmake --build . --target clang --parallel ${{ env.ncpus }}
243-
cmake --build . --target cling --parallel ${{ env.ncpus }}
244+
ninja clang -j ${{ env.ncpus }}
245+
ninja cling -j ${{ env.ncpus }}
244246
# Now build gtest.a and gtest_main for CppInterOp to run its tests.
245-
cmake --build . --target gtest_main --parallel ${{ env.ncpus }}
247+
ninja gtest_main -j ${{ env.ncpus }}
246248
else
247249
# Apply patches
248250
llvm_vers=$(echo "${{ matrix.clang-runtime }}" | tr '[:lower:]' '[:upper:]')
@@ -262,9 +264,9 @@ jobs:
262264
-DLLVM_ENABLE_ZSTD=OFF \
263265
-DLLVM_ENABLE_TERMINFO=OFF \
264266
-DLLVM_ENABLE_LIBXML2=OFF \
267+
-G Ninja \
265268
../llvm
266-
cmake --build . --target clang clang-repl --parallel ${{ env.ncpus }}
267-
269+
ninja clang clang-repl -j ${{ env.ncpus }}
268270
fi
269271
cd ../
270272
rm -rf $(find . -maxdepth 1 ! -name "build" ! -name "llvm" ! -name "clang" ! -name ".")

.github/workflows/Ubuntu.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ jobs:
140140
run: |
141141
# Install deps
142142
sudo apt-get update
143-
sudo apt-get install valgrind
143+
sudo apt-get install valgrind ninja-build
144144
sudo apt-get autoremove
145145
sudo apt-get clean
146146
@@ -175,11 +175,12 @@ jobs:
175175
-DLLVM_ENABLE_ZSTD=OFF \
176176
-DLLVM_ENABLE_TERMINFO=OFF \
177177
-DLLVM_ENABLE_LIBXML2=OFF \
178+
-G Ninja \
178179
../llvm
179-
cmake --build . --target clang --parallel ${{ env.ncpus }}
180-
cmake --build . --target cling --parallel ${{ env.ncpus }}
180+
ninja clang -j ${{ env.ncpus }}
181+
ninja cling -j ${{ env.ncpus }}
181182
# Now build gtest.a and gtest_main for CppInterOp to run its tests.
182-
cmake --build . --target gtest_main --parallel ${{ env.ncpus }}
183+
ninja gtest_main -j ${{ env.ncpus }}
183184
else
184185
# Apply patches
185186
llvm_vers=$(echo "${{ matrix.clang-runtime }}" | tr '[:lower:]' '[:upper:]')
@@ -199,9 +200,9 @@ jobs:
199200
-DLLVM_ENABLE_ZSTD=OFF \
200201
-DLLVM_ENABLE_TERMINFO=OFF \
201202
-DLLVM_ENABLE_LIBXML2=OFF \
203+
-G Ninja \
202204
../llvm
203-
cmake --build . --target clang clang-repl --parallel ${{ env.ncpus }}
204-
205+
ninja clang clang-repl -j ${{ env.ncpus }}
205206
fi
206207
cd ../
207208
rm -rf $(find . -maxdepth 1 ! -name "build" ! -name "llvm" ! -name "clang" ! -name ".")

0 commit comments

Comments
 (0)