-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuildAwfui.sh
More file actions
executable file
·30 lines (23 loc) · 862 Bytes
/
Copy pathbuildAwfui.sh
File metadata and controls
executable file
·30 lines (23 loc) · 862 Bytes
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
27
28
29
30
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
CLEAN=""
TARGET=""
PRESET=""
for arg in "$@"; do
case "$arg" in
-a) CLEAN="--clean-first" ;;
-aw) CLEAN="--clean-first"; TARGET="--target awfui" ;;
-as) CLEAN="--clean-first"; TARGET="--target awfui_sdl" ;;
-ae) CLEAN="--clean-first"; TARGET="--target awfui_demo --target awfui_test --target awfui_justsdl --target awfui_keypad" ;;
*) [ -z "$PRESET" ] && PRESET="$arg" ;;
esac
done
PRESET="${PRESET:-sdl-ninja}"
if [ -n "$CLEAN" ]; then
echo "=== Rebuilding AWFUI (${PRESET}) ==="
else
echo "=== Building AWFUI (${PRESET}) ==="
fi
cmake --preset "${PRESET}" -S "${SCRIPT_DIR}"
cmake --build --preset "${PRESET}" ${CLEAN} ${TARGET} || cmake --build "${SCRIPT_DIR}/build/${PRESET}" ${CLEAN} ${TARGET}