looper/build.sh

33 lines
776 B
Bash
Raw Permalink 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
2024-10-26 09:01:06 -07:00
run_command cmake .. -DDISABLE_GTK_UI=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_POLICY_DEFAULT_CMP0069=NEW -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_C{,XX}_FLAGS="-O2 -march=native" -DBUILD_SOUNDTOUCH=ON
2024-08-08 13:12:37 -07:00
run_command cmake --build . "$@"
2024-09-16 15:05:53 -07:00
cd "$OLD_DIR"