GDExtensionTemplate/build/build.sh
somebody_master 58efe4ec04
No permitir ninguna opción más tras construir y crear bd
Signed-off-by: somebody_master <somebody_master@somebodyserver.mooo.com>
2023-02-12 14:16:10 +01:00

47 lines
879 B
Bash
Executable File

#!/usr/bin/env bash
function clean() {
cd gdextension || return 1
scons --clean
cd ..
}
function build() {
cd gdextension || return 1
scons
cd ..
}
function build_db() {
clean
cd gdextension || return 1
bear -- scons
if [ ! -d ../build ]; then
mkdir ../build
touch ../build/.gdignore
fi
if [ -f ../build/compile_commands.json ]; then
rm ../build/compile_commands.json
fi
cp compile_commands.json ../build/
cd ..
}
while getopts "bdch" flag; do
case "$flag" in
d) build_db && exit 0 ;;
b) build && exit 0 ;;
c) clean ;;
h) echo "Use -b for build , -d for generating a compile_commands.json or -c for cleaning" ;;
?)
echo "script usage: $(basename \$0) [-b] [-d] [-c] [-h]" >&2
exit 1
;;
esac
done
exit 0