2024-07-29 22:20:30 +00:00
|
|
|
#!/bin/env sh
|
|
|
|
|
2024-10-13 16:02:27 +00:00
|
|
|
# check whether ninja is around (you better start running)
|
|
|
|
if [ -x "$(command -v ninja)" ]; then
|
|
|
|
generator="-G Ninja"
|
|
|
|
fi
|
|
|
|
|
2024-10-18 17:33:46 +00:00
|
|
|
# check whether clang is around (it's just better)
|
|
|
|
if [ -x "$(command -v clang)" ]; then
|
|
|
|
cc="-DCMAKE_C_COMPILER=clang"
|
|
|
|
fi
|
|
|
|
|
2024-09-25 16:51:39 +00:00
|
|
|
if [ "$1" = "web" ]; then
|
2024-10-18 17:33:46 +00:00
|
|
|
emcmake cmake $generator $cc -B .build-web "${@:2}" && cmake --build .build-web --parallel
|
2024-09-16 06:07:01 +00:00
|
|
|
else
|
2024-10-18 17:33:46 +00:00
|
|
|
cmake $generator $cc -B .build "$@" && cmake --build .build --parallel
|
2024-09-16 06:07:01 +00:00
|
|
|
fi
|