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
203 lines
7.1 KiB
Bash
203 lines
7.1 KiB
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
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
|
|
force) build_option="--build=*" ;;
|
|
missing) build_option="--build=missing" ;;
|
|
*)
|
|
usage
|
|
exit 1
|
|
;;
|
|
esac
|
|
shift
|
|
|
|
profile_name="clang"
|
|
build_profile_arg=""
|
|
variant_arg=""
|
|
unity_val=""
|
|
tracy_val="True"
|
|
build_type_arg=""
|
|
|
|
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)
|
|
if [[ -n "$build_type_arg" ]]; then
|
|
echo "ERROR: build type specified more than once"
|
|
exit 1
|
|
fi
|
|
build_type_arg="$arg"
|
|
;;
|
|
*)
|
|
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."
|
|
else
|
|
echo "Adding Conan remote: bigfootpackages"
|
|
if ! conan remote add bigfootpackages https://conan.romainboullard.com/artifactory/api/conan/BigfootPackages; then
|
|
echo "ERROR: Failed to add Conan remote."
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
# ─── Shared flags ─────────────────────────────────────────────────────────────
|
|
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="${host_profile}"
|
|
-pr:b="${build_profile}"
|
|
-o "bigfoot/*:build_tests=True"
|
|
-o "bigfoot/*:build_benchmarks=True"
|
|
-o "bigfoot/*:tracy=${tracy_val}"
|
|
-o "bigfoot/*:vulkan=True"
|
|
)
|
|
|
|
# ─── Install dependencies for each build type/variant ─────────────────────────
|
|
for build_type in "${build_types[@]}"; do
|
|
echo
|
|
echo "[${build_type}] Installing dependencies..."
|
|
|
|
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
|
|
|
|
echo
|
|
echo "All build types installed successfully."
|
|
|
|
# ─── Configure CMake for each build type ─────────────────────────────────────
|
|
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 "${variants[@]}"; do
|
|
# shellcheck disable=SC1090
|
|
source "build-linux-${variant}/build/${build_type}/generators/conanbuild.sh"
|
|
|
|
mkdir -p "graphviz-linux-${variant}/${build_type}"
|
|
|
|
echo "[${build_type}] Running CMake (${variant})..."
|
|
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})."
|
|
exit 1
|
|
fi
|
|
done
|
|
echo "[${build_type}] Done."
|
|
done
|
|
|
|
echo
|
|
echo "CMake configuration successful."
|