Skip to content

Commit

Permalink
add fallback for ninja and win32
Browse files Browse the repository at this point in the history
  • Loading branch information
KurtGokhan committed Apr 7, 2024
1 parent b535c4d commit b4f2374
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions generate_build
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@

rm -rf build

if which ninja; then

if [ "$#" -eq 0 ]; then
build_cmd=""
else
build_cmd="$@"
fi

if [[ $build_cmd != *"-A Win32"* && -x $(command -v ninja) ]]; then
set -e
cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON -G Ninja "$@" \
|| cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON "$@"
cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON -G Ninja "$build_cmd"
else
set -e
cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON "$@"
cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON "$build_cmd"
fi

cmake --build build --config Release

0 comments on commit b4f2374

Please sign in to comment.