Skip to content

Commit b4f2374

Browse files
committed
add fallback for ninja and win32
1 parent b535c4d commit b4f2374

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

generate_build

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,19 @@
66

77
rm -rf build
88

9-
if which ninja; then
9+
10+
if [ "$#" -eq 0 ]; then
11+
build_cmd=""
12+
else
13+
build_cmd="$@"
14+
fi
15+
16+
if [[ $build_cmd != *"-A Win32"* && -x $(command -v ninja) ]]; then
1017
set -e
11-
cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON -G Ninja "$@" \
12-
|| cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON "$@"
18+
cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON -G Ninja "$build_cmd"
1319
else
1420
set -e
15-
cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON "$@"
21+
cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON "$build_cmd"
1622
fi
1723

1824
cmake --build build --config Release

0 commit comments

Comments
 (0)