[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.
This commit is contained in:
Louis Dionne 2021-02-26 12:13:51 -05:00
parent a00f7dc2d5
commit f8e810c359
1 changed files with 4 additions and 0 deletions

View File

@ -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" \