Files
Bin2CPP/generate_bin2cpp.sh
Romain BOULLARD 5e7d9c8a00
All checks were successful
Bin2CPP / Build & Test Debug with ./ConanProfiles/clang (Unity Build: OFF) (push) Successful in 4m36s
Bin2CPP / Build & Test Debug with ./ConanProfiles/clang (Unity Build: ON) (push) Successful in 4m39s
Bin2CPP / Build & Test Debug with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Successful in 4m42s
Bin2CPP / Build & Test Debug with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Successful in 4m38s
Bin2CPP / Build & Test RelWithDebInfo with ./ConanProfiles/clang (Unity Build: OFF) (push) Successful in 4m51s
Bin2CPP / Build & Test RelWithDebInfo with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Successful in 4m59s
Conan Packaging / Package Bin2CPP/1.0.0 (push) Successful in 4m45s
Bin2CPP / Build & Test RelWithDebInfo with ./ConanProfiles/clang (Unity Build: ON) (push) Successful in 4m49s
Bin2CPP / Build & Test RelWithDebInfo with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Successful in 4m53s
Bin2CPP / Build & Test Release with ./ConanProfiles/clang (Unity Build: OFF) (push) Successful in 4m42s
Bin2CPP / Build & Test Release with ./ConanProfiles/clang (Unity Build: ON) (push) Successful in 4m46s
Bin2CPP / Build & Test Release with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Successful in 4m53s
Bin2CPP / Build & Test Release with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Successful in 4m51s
Bin2CPP / Clang Format Checks (push) Successful in 9s
Bin2CPP / Sonarqube (push) Successful in 5m8s
No CPPTrace (#8)
Reviewed-on: #8
Co-authored-by: Romain BOULLARD <romain.boullard@protonmail.com>
Co-committed-by: Romain BOULLARD <romain.boullard@protonmail.com>
2026-04-27 06:58:29 +00:00

100 lines
3.8 KiB
Bash
Executable File

#!/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"
echo " build_type (optional) - One of: Release, RelWithDebInfo, Debug"
echo " If omitted, all build types are processed"
exit 1
fi
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"
exit 1
;;
esac
# ─── Validate optional build_type argument ────────────────────────────────────
all_build_types=(Release RelWithDebInfo Debug)
if [[ -n "${2:-}" ]]; then
case "${2}" in
Release|RelWithDebInfo|Debug)
build_types=("${2}")
;;
*)
echo "ERROR: Invalid build type '${2}'. Must be one of: Release, RelWithDebInfo, Debug"
exit 1
;;
esac
else
build_types=("${all_build_types[@]}")
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 ─────────────────────────────────────────────────────────────
conan_common=(
--remote=bigfootpackages
-pr:h=./ConanProfiles/clang
-pr:b=./ConanProfiles/Tools/clang
-of build
)
# ─── Install dependencies for each build type ─────────────────────────────────
for build_type in "${build_types[@]}"; do
echo
echo "[${build_type}] Installing dependencies..."
if ! conan install . "${conan_common[@]}" ${build_option} -s:h "build_type=${build_type}"; then
echo "ERROR: conan install failed for build type ${build_type}"
exit 1
fi
echo "[${build_type}] Done."
done
echo
echo "All selected build types installed successfully."
# ─── Configure CMake for each build type ─────────────────────────────────────
echo
echo "Configuring CMake for each build type..."
for build_type in "${build_types[@]}"; do
echo
echo "[${build_type}] Activating build environment..."
# shellcheck disable=SC1090
source "build/build/${build_type}/generators/conanbuild.sh"
mkdir -p "graphviz/${build_type}"
echo "[${build_type}] Running CMake..."
if ! cmake -S . -B "build/${build_type}" \
--toolchain "build/build/${build_type}/generators/conan_toolchain.cmake" \
-DCMAKE_BUILD_TYPE="${build_type}" \
-G "Ninja" \
--graphviz="graphviz/${build_type}/graph.dot"; then
echo "ERROR: CMake configuration failed for build type ${build_type}."
exit 1
fi
echo "[${build_type}] Done."
done
echo
echo "CMake configuration successful."