Files
Vita3K/.ci/build-desktop.sh
T
KorewaWatchful cf37c74444 ci: overhaul ci
2026-05-21 10:50:42 -04:00

40 lines
759 B
Bash

#!/usr/bin/env bash
set -euo pipefail
source "$(dirname "$0")/common.sh"
PRESET=""
CONFIG=""
RUN_TESTS="true"
while [[ $# -gt 0 ]]; do
case "$1" in
--preset)
PRESET="$2"
shift 2
;;
--config)
CONFIG="$2"
shift 2
;;
--skip-tests)
RUN_TESTS="false"
shift
;;
*)
echo "Unknown argument: $1" >&2
exit 1
;;
esac
done
require_arg "$PRESET" "preset"
require_arg "$CONFIG" "config"
cmake --preset "$PRESET"
cmake --build "build/$PRESET" --config "$CONFIG"
if [[ "$RUN_TESTS" == "true" ]]; then
ctest --test-dir "build/$PRESET" --build-config "$CONFIG" --output-on-failure
fi