looper/build.sh

33 lines
638 B
Bash
Raw Normal View History

2024-08-08 13:12:37 -07:00
#!/bin/bash
export OLD_DIR="$(pwd)"
cmd_err() {
CUR_DIR="$(pwd)"
code=$1
echo "Error: Command exited with non-zero status ($code)" >&2
echo "Directory: $CUR_DIR"
echo "Command: $2" >&2
cd $OLD_DIR
exit $code
}
on_err() {
echo "Script error."
cmd_err "$?" "$BASH_COMMAND"
}
run_command() {
trap ERR
echo "$@" >&2
"$@"
code=$?
if [ $code -ne 0 ]; then
cmd_err "$code" "$*"
fi
trap on_err ERR
}
trap on_err ERR
2024-09-16 15:05:53 -07:00
cd "$(dirname "$0")"
2024-08-08 13:12:37 -07:00
mkdir -p build
cd build
run_command cmake .. -DDISABLE_GTK_UI=ON -DCMAKE_BUILD_TYPE=Debug
run_command cmake --build . "$@"
2024-09-16 15:05:53 -07:00
cd "$OLD_DIR"