#!/bin/env sh

# check whether ninja is around (you better start running)
if [ -x "$(command -v ninja)" ]; then
    generator="-G Ninja"
fi

if [ "$1" = "web" ]; then
    emcmake cmake $generator -B .build-web "${@:2}" && cmake --build .build-web --parallel
else
    cmake $generator -B .build "$@" && cmake --build .build --parallel
fi
