[libcxx-commits] [libcxx] f8e810c - [libc++] Allow running CI on macOS when Ninja isn't installed outside of Xcode

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri Feb 26 09:15:20 PST 2021


Author: Louis Dionne
Date: 2021-02-26T12:15:12-05:00
New Revision: f8e810c359b51c911dfb3be1f8c48f28356c09ec

URL: https://github.com/llvm/llvm-project/commit/f8e810c359b51c911dfb3be1f8c48f28356c09ec
DIFF: https://github.com/llvm/llvm-project/commit/f8e810c359b51c911dfb3be1f8c48f28356c09ec.diff

LOG: [libc++] Allow running CI on macOS when Ninja isn't installed outside of Xcode

Xcode does bundle Ninja, so we can use that Ninja if there's no system-wide
Ninja installed. This is useful on some CI bots we have that don't come
with Ninja pre-installed.

Added: 
    

Modified: 
    libcxx/utils/ci/run-buildbot

Removed: 
    


################################################################################
diff  --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot
index 56ece0218270..09ddd65848bc 100755
--- a/libcxx/utils/ci/run-buildbot
+++ b/libcxx/utils/ci/run-buildbot
@@ -67,9 +67,13 @@ function clean() {
 
 function generate-cmake() {
     echo "--- Generating CMake"
+    # On macOS, fall back to using the Ninja provided with Xcode if no other
+    # Ninja can be found.
+    if which ninja &>/dev/null; then ninja_path="$(which ninja)"; else ninja_path="$(xcrun --find ninja)"; fi
     cmake -S "${MONOREPO_ROOT}/llvm" \
           -B "${BUILD_DIR}" \
           -GNinja \
+          -DCMAKE_MAKE_PROGRAM="${ninja_path}" \
           -DCMAKE_BUILD_TYPE=RelWithDebInfo \
           -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
           -DLLVM_ENABLE_PROJECTS="libcxx;libunwind;libcxxabi" \


        


More information about the libcxx-commits mailing list