Refactoring generate scripts + scoped asan disabler
Bigfoot / Sonarqube (game) (push) Skipped
Bigfoot / Sonarqube (toolmode) (push) Skipped
Bigfoot / Build & Test Debug with clang (Unity Build: OFF, Variant: game) (push) Successful in 1m7s
Bigfoot / Build & Test Debug with clang (Unity Build: OFF, Variant: toolmode) (push) Successful in 1m10s
Bigfoot / Build & Test Debug with clang (Unity Build: ON, Variant: game) (push) Successful in 46s
Bigfoot / Build & Test Debug with clang (Unity Build: ON, Variant: toolmode) (push) Successful in 50s
Bigfoot / Build & Test Debug with clang_asan (Unity Build: OFF, Variant: game) (push) Successful in 6m1s
Bigfoot / Build & Test Debug with clang_asan (Unity Build: OFF, Variant: toolmode) (push) Successful in 2m21s
Bigfoot / Build & Test Debug with clang_asan (Unity Build: ON, Variant: game) (push) Successful in 1m49s
Bigfoot / Build & Test Debug with clang_asan (Unity Build: ON, Variant: toolmode) (push) Successful in 1m56s
Bigfoot / Build & Test Release with clang (Unity Build: OFF, Variant: game) (push) Successful in 1m2s
Bigfoot / Build & Test Release with clang (Unity Build: OFF, Variant: toolmode) (push) Successful in 1m27s
Bigfoot / Build & Test Release with clang (Unity Build: ON, Variant: game) (push) Successful in 49s
Bigfoot / Build & Test Release with clang_asan (Unity Build: OFF, Variant: game) (push) Successful in 9m26s
Bigfoot / Build & Test Release with clang_asan (Unity Build: ON, Variant: toolmode) (push) Successful in 1m39s
Bigfoot / Build & Test RelWithDebInfo with clang (Unity Build: OFF, Variant: toolmode) (push) Successful in 1m18s
Bigfoot / Build & Test RelWithDebInfo with clang (Unity Build: ON, Variant: toolmode) (push) Successful in 52s
Bigfoot / Build & Test RelWithDebInfo with clang_asan (Unity Build: OFF, Variant: game) (push) Successful in 7m59s
Bigfoot / Build & Test RelWithDebInfo with clang_asan (Unity Build: OFF, Variant: toolmode) (push) Successful in 2m23s
Bigfoot / Build & Test RelWithDebInfo with clang_asan (Unity Build: ON, Variant: toolmode) (push) Successful in 1m58s
Bigfoot / Build & Test Release with clang (Unity Build: ON, Variant: toolmode) (push) Successful in 1m13s
Bigfoot / Build & Test Release with clang_asan (Unity Build: OFF, Variant: toolmode) (push) Successful in 1m51s
Bigfoot / Build & Test Release with clang_asan (Unity Build: ON, Variant: game) (push) Successful in 1m32s
Bigfoot / Build & Test RelWithDebInfo with clang (Unity Build: OFF, Variant: game) (push) Successful in 1m12s
Bigfoot / Build & Test RelWithDebInfo with clang (Unity Build: ON, Variant: game) (push) Successful in 50s
Bigfoot / Build & Test RelWithDebInfo with clang_asan (Unity Build: ON, Variant: game) (push) Successful in 1m50s
Bigfoot / Clang Format Checks (push) Successful in 12s

This commit is contained in:
2026-09-12 10:37:06 +02:00
parent 6ee035843e
commit c4e9f6f7d9
7 changed files with 290 additions and 90 deletions
+121 -44
View File
@@ -1,44 +1,110 @@
#!/usr/bin/env bash
set -euo pipefail
# ─── Validate arguments ───────────────────────────────────────────────────────
if [[ $# -lt 1 ]]; then
echo "Usage: $(basename "$0") [force|missing] [Release|RelWithDebInfo|Debug]"
echo " force - Rebuild all packages from source"
echo " missing - Only build packages not already cached"
usage() {
echo "Usage: $(basename "$0") [force|missing] [Release|RelWithDebInfo|Debug] [--profile=<name>] [--build-profile=<name>] [--variant=toolmode|game] [--unity=ON|OFF] [--tracy=True|False]"
echo " force - Rebuild all packages from source"
echo " missing - Only build packages not already cached"
echo " build_type (optional) - One of: Release, RelWithDebInfo, Debug"
echo " If omitted, all build types are processed"
echo " --profile=<name> (optional) - Conan host profile under ./ConanProfiles/host (default: clang)"
echo " --build-profile=<name> (optional) - Conan build profile under ./ConanProfiles/build"
echo " If omitted, it is derived from --profile: ./ConanProfiles/build/clang,"
echo " or .../clang_asan when <name> contains 'asan'"
echo " --variant=<name> (optional) - One of: toolmode, game. If omitted, both are processed"
echo " --unity=<ON|OFF> (optional) - Sets CMAKE_UNITY_BUILD. If omitted, CMake's own default applies"
echo " --tracy=<True|False> (optional) - Sets the bigfoot/*:tracy option (default: True)"
}
# ─── Validate arguments ───────────────────────────────────────────────────────
if [[ $# -lt 1 ]]; then
usage
exit 1
fi
case "${1:-}" in
case "$1" in
force) build_option="--build=*" ;;
missing) build_option="--build=missing" ;;
*)
echo "Usage: $(basename "$0") [force|missing] [Release|RelWithDebInfo|Debug]"
echo " force - Rebuild all packages from source"
echo " missing - Only build packages not already cached"
usage
exit 1
;;
esac
shift
# ─── Validate optional build_type argument ────────────────────────────────────
all_build_types=(Release RelWithDebInfo Debug)
profile_name="clang"
build_profile_arg=""
variant_arg=""
unity_val=""
tracy_val="True"
build_type_arg=""
if [[ -n "${2:-}" ]]; then
case "${2}" in
for arg in "$@"; do
case "$arg" in
--profile=*)
profile_name="${arg#--profile=}"
;;
--build-profile=*)
build_profile_arg="${arg#--build-profile=}"
;;
--variant=*)
variant_arg="${arg#--variant=}"
case "$variant_arg" in
toolmode|game) ;;
*)
echo "ERROR: Invalid variant '${variant_arg}'. Must be one of: toolmode, game"
exit 1
;;
esac
;;
--unity=*)
unity_val="${arg#--unity=}"
case "$unity_val" in
ON|OFF) ;;
*)
echo "ERROR: Invalid value for --unity '${unity_val}'. Must be ON or OFF"
exit 1
;;
esac
;;
--tracy=*)
tracy_val="${arg#--tracy=}"
case "$tracy_val" in
True|False) ;;
*)
echo "ERROR: Invalid value for --tracy '${tracy_val}'. Must be True or False"
exit 1
;;
esac
;;
Release|RelWithDebInfo|Debug)
build_types=("${2}")
if [[ -n "$build_type_arg" ]]; then
echo "ERROR: build type specified more than once"
exit 1
fi
build_type_arg="$arg"
;;
*)
echo "ERROR: Invalid build type '${2}'. Must be one of: Release, RelWithDebInfo, Debug"
echo "ERROR: Unrecognized argument '${arg}'"
usage
exit 1
;;
esac
done
all_build_types=(Release RelWithDebInfo Debug)
if [[ -n "$build_type_arg" ]]; then
build_types=("$build_type_arg")
else
build_types=("${all_build_types[@]}")
fi
if [[ -n "$variant_arg" ]]; then
variants=("$variant_arg")
else
variants=(toolmode game)
fi
# ─── Register remote (skip if already registered) ─────────────────────────────
if conan remote list 2>/dev/null | grep -qi "bigfootpackages"; then
echo "Conan remote 'bigfootpackages' already registered, skipping."
@@ -51,43 +117,48 @@ else
fi
# ─── Shared flags ─────────────────────────────────────────────────────────────
conan_common_toolmode=(
host_profile="./ConanProfiles/host/${profile_name}"
if [[ -n "$build_profile_arg" ]]; then
build_profile="./ConanProfiles/build/${build_profile_arg}"
else
build_profile="./ConanProfiles/build/clang"
if [[ "$profile_name" == *asan* ]]; then
build_profile="./ConanProfiles/build/clang_asan"
fi
fi
conan_common_base=(
--remote=bigfootpackages
-pr:h=./ConanProfiles/host/clang
-pr:b=./ConanProfiles/build/clang
-of build-linux-toolmode
-pr:h="${host_profile}"
-pr:b="${build_profile}"
-o "bigfoot/*:build_tests=True"
-o "bigfoot/*:build_benchmarks=True"
-o "bigfoot/*:tracy=True"
-o "bigfoot/*:tracy=${tracy_val}"
-o "bigfoot/*:vulkan=True"
-o "bigfoot/*:toolmode=True"
)
conan_common_game=(
--remote=bigfootpackages
-pr:h=./ConanProfiles/host/clang
-pr:b=./ConanProfiles/build/clang
-of build-linux-game
-o "bigfoot/*:build_tests=True"
-o "bigfoot/*:build_benchmarks=True"
-o "bigfoot/*:tracy=True"
-o "bigfoot/*:vulkan=True"
-o "bigfoot/*:toolmode=False"
)
# ─── Install dependencies for each build type ─────────────────────────────────
# ─── Install dependencies for each build type/variant ─────────────────────────
for build_type in "${build_types[@]}"; do
echo
echo "[${build_type}] Installing dependencies..."
build_type_profile="./ConanProfiles/Configurations/${build_type,,}"
if ! conan install . "${conan_common_toolmode[@]}" ${build_option} -pr:h="${build_type_profile}" -pr:b="${build_type_profile}"; then
echo "ERROR: conan install failed for build type ${build_type}"
exit 1
fi
if ! conan install . "${conan_common_game[@]}" ${build_option} -pr:h="${build_type_profile}" -pr:b="${build_type_profile}"; then
echo "ERROR: conan install failed for build type ${build_type}"
exit 1
config_profile="./ConanProfiles/Configurations/${build_type,,}"
if [[ "$profile_name" == *asan* && "$build_type" == "Release" ]]; then
config_profile="./ConanProfiles/Configurations/release_noipo"
fi
for variant in "${variants[@]}"; do
toolmode_val="False"
[[ "$variant" == "toolmode" ]] && toolmode_val="True"
if ! conan install . "${conan_common_base[@]}" ${build_option} \
-pr:h="${config_profile}" -pr:b="${config_profile}" \
-o "bigfoot/*:toolmode=${toolmode_val}" \
-of "build-linux-${variant}"; then
echo "ERROR: conan install failed for build type ${build_type} (${variant})"
exit 1
fi
done
echo "[${build_type}] Done."
done
@@ -98,11 +169,16 @@ echo "All build types installed successfully."
echo
echo "Configuring CMake for each build type..."
unity_args=()
if [[ -n "$unity_val" ]]; then
unity_args=(-DCMAKE_UNITY_BUILD="${unity_val}")
fi
for build_type in "${build_types[@]}"; do
echo
echo "[${build_type}] Activating build environment..."
for variant in toolmode game; do
for variant in "${variants[@]}"; do
# shellcheck disable=SC1090
source "build-linux-${variant}/build/${build_type}/generators/conanbuild.sh"
@@ -112,6 +188,7 @@ for build_type in "${build_types[@]}"; do
if ! cmake -S . -B "build-linux-${variant}/${build_type}" \
--toolchain "build-linux-${variant}/build/${build_type}/generators/conan_toolchain.cmake" \
-DCMAKE_BUILD_TYPE="${build_type}" \
"${unity_args[@]}" \
-G "Ninja" \
--graphviz="graphviz-linux-${variant}/${build_type}/graph.dot"; then
echo "ERROR: CMake configuration failed for build type ${build_type} (${variant})."
@@ -122,4 +199,4 @@ for build_type in "${build_types[@]}"; do
done
echo
echo "CMake configuration successful."
echo "CMake configuration successful."