From 508823a690aadabaf519c8ea9a334748a11f2c05 Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Thu, 9 Jan 2025 10:16:23 +0000 Subject: [PATCH] Use Ninja to build llvm in the ci (#423) --- .github/workflows/MacOS.yml | 12 +++++++----- .github/workflows/Ubuntu.yml | 13 +++++++------ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/MacOS.yml b/.github/workflows/MacOS.yml index 0eab8780..d4411fd1 100644 --- a/.github/workflows/MacOS.yml +++ b/.github/workflows/MacOS.yml @@ -206,6 +206,7 @@ jobs: done brew upgrade openssl >/dev/null 2>&1 brew upgrade + brew install ninja - name: Build LLVM/Cling if the cache is invalid if: ${{ steps.cache.outputs.cache-hit != 'true' }} @@ -238,11 +239,12 @@ jobs: -DLLVM_ENABLE_ZSTD=OFF \ -DLLVM_ENABLE_TERMINFO=OFF \ -DLLVM_ENABLE_LIBXML2=OFF \ + -G Ninja \ ../llvm - cmake --build . --target clang --parallel ${{ env.ncpus }} - cmake --build . --target cling --parallel ${{ env.ncpus }} + ninja clang -j ${{ env.ncpus }} + ninja cling -j ${{ env.ncpus }} # Now build gtest.a and gtest_main for CppInterOp to run its tests. - cmake --build . --target gtest_main --parallel ${{ env.ncpus }} + ninja gtest_main -j ${{ env.ncpus }} else # Apply patches llvm_vers=$(echo "${{ matrix.clang-runtime }}" | tr '[:lower:]' '[:upper:]') @@ -262,9 +264,9 @@ jobs: -DLLVM_ENABLE_ZSTD=OFF \ -DLLVM_ENABLE_TERMINFO=OFF \ -DLLVM_ENABLE_LIBXML2=OFF \ + -G Ninja \ ../llvm - cmake --build . --target clang clang-repl --parallel ${{ env.ncpus }} - + ninja clang clang-repl -j ${{ env.ncpus }} fi cd ../ rm -rf $(find . -maxdepth 1 ! -name "build" ! -name "llvm" ! -name "clang" ! -name ".") diff --git a/.github/workflows/Ubuntu.yml b/.github/workflows/Ubuntu.yml index ae3e37dc..423af073 100644 --- a/.github/workflows/Ubuntu.yml +++ b/.github/workflows/Ubuntu.yml @@ -140,7 +140,7 @@ jobs: run: | # Install deps sudo apt-get update - sudo apt-get install valgrind + sudo apt-get install valgrind ninja-build sudo apt-get autoremove sudo apt-get clean @@ -175,11 +175,12 @@ jobs: -DLLVM_ENABLE_ZSTD=OFF \ -DLLVM_ENABLE_TERMINFO=OFF \ -DLLVM_ENABLE_LIBXML2=OFF \ + -G Ninja \ ../llvm - cmake --build . --target clang --parallel ${{ env.ncpus }} - cmake --build . --target cling --parallel ${{ env.ncpus }} + ninja clang -j ${{ env.ncpus }} + ninja cling -j ${{ env.ncpus }} # Now build gtest.a and gtest_main for CppInterOp to run its tests. - cmake --build . --target gtest_main --parallel ${{ env.ncpus }} + ninja gtest_main -j ${{ env.ncpus }} else # Apply patches llvm_vers=$(echo "${{ matrix.clang-runtime }}" | tr '[:lower:]' '[:upper:]') @@ -199,9 +200,9 @@ jobs: -DLLVM_ENABLE_ZSTD=OFF \ -DLLVM_ENABLE_TERMINFO=OFF \ -DLLVM_ENABLE_LIBXML2=OFF \ + -G Ninja \ ../llvm - cmake --build . --target clang clang-repl --parallel ${{ env.ncpus }} - + ninja clang clang-repl -j ${{ env.ncpus }} fi cd ../ rm -rf $(find . -maxdepth 1 ! -name "build" ! -name "llvm" ! -name "clang" ! -name ".")