townengine/bin/build.sh

20 lines
476 B
Bash
Raw Normal View History

2024-07-29 22:20:30 +00:00
#!/bin/env sh
2025-01-03 08:55:39 +00:00
set +e
# check whether ninja is around (you better start running)
if [ -x "$(command -v ninja)" ]; then
generator="-G Ninja"
fi
# check whether clang is around (it's just better)
if [ -x "$(command -v clang)" ]; then
cc="-DCMAKE_C_COMPILER=clang"
fi
if [ "$1" = "web" ]; then
emcmake cmake $generator $cc -B build-web "${@:2}" && cmake --build build-web --parallel
else
cmake $generator $cc -B build "$@" && cmake --build build --parallel
fi