-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathcompile_debug.sh
More file actions
executable file
·26 lines (26 loc) · 1.17 KB
/
Copy pathcompile_debug.sh
File metadata and controls
executable file
·26 lines (26 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
# Tests are built by default (simple_test_exec and the *_tester modules) and the fast
# gate runs before installation; --exclude-tests builds the library and executables only.
# --traps adds floating-point traps and signalling-NaN initialisation (SIMPLE_DEBUG_TRAPS).
BUILD_TESTS=ON
DEBUG_TRAPS=OFF
ROOT="$(cd "$(dirname "$0")" && pwd)"
for arg in "$@"; do
case "$arg" in
--exclude-tests) BUILD_TESTS=OFF ;;
--traps) DEBUG_TRAPS=ON ;;
-h|--help) echo "usage: $(basename "$0") [--exclude-tests] [--traps]"; exit 0 ;;
*) echo "$(basename "$0"): unknown option: $arg (see --help)" >&2; exit 1 ;;
esac
done
rm -rf build
mkdir build
cd build
cmake -DBUILD_TESTS=${BUILD_TESTS} -DSIMPLE_DEBUG_TRAPS=${DEBUG_TRAPS} .. -DCMAKE_BUILD_TYPE=debug
make -j || exit $?
# Unless --exclude-tests is given, the build-time test gate (scripts/run_fast_gate.sh)
# runs between build and install, as in X: a failed gate is a failed build and
# nothing is installed; its status is the script's status.
if [ "$BUILD_TESTS" = ON ]; then "$ROOT/scripts/run_fast_gate.sh" "$PWD" || GATE_RC=$?; fi
[ "${GATE_RC:-0}" = 0 ] && { make install || exit $?; }
exit ${GATE_RC:-0}