BigFile/Sasquatch #1

Merged
rboullard merged 100 commits from BigFile into Development 2026-09-01 16:32:02 +00:00
12 changed files with 110 additions and 101 deletions
Showing only changes of commit 0ba9e062d4 - Show all commits
+17
View File
@@ -0,0 +1,17 @@
{
"permissions": {
"allow": [
"Bash(./EngineTests.exe)",
"Bash(echo \"EXIT: $?\")",
"Bash(cmake --build build-windows --target EngineTests --config Debug -- -m)",
"Bash(cmake --build build-windows --config Debug -- -m)",
"Bash(./SystemTests.exe)",
"Bash(./UtilsTests.exe)",
"Bash(cmake --build build-windows --target EngineBenchmarks --config RelWithDebInfo -- -m)",
"Bash(./EngineBenchmarks.exe --benchmark_counters_tabular=true)",
"Bash(cmake --build build-windows --target EngineBenchmarks --config Release -- -m)",
"Bash(./EngineBenchmarks.exe --benchmark_repetitions=10 --benchmark_report_aggregates_only=true)",
"Bash(cmake . -G \"Visual Studio 17 2022\")"
]
}
}
+10 -9
View File
@@ -18,7 +18,8 @@ jobs:
build_type: ["Debug", "RelWithDebInfo", "Release"]
unity_build: ["ON", "OFF"]
conan_profile: ["./ConanProfiles/host/clang", "./ConanProfiles/host/clang_asan"]
name: "Build & Test ${{ matrix.build_type }} with ${{ matrix.conan_profile }} (Unity Build: ${{ matrix.unity_build }})"
toolmode: ["True", "False"]
name: "Build & Test ${{ matrix.build_type }} with ${{ matrix.conan_profile }} (Unity Build: ${{ matrix.unity_build }}, Toolmode: ${{ matrix.toolmode }})"
steps:
- name: Install Node.js
run: apt-get update && apt-get install -y nodejs
@@ -30,18 +31,18 @@ jobs:
- name: Build
run: |
conan install . --remote=bigfootpackages -pr:h=${{ matrix.conan_profile }} -pr:b=./ConanProfiles/build/clang --build=* -s build_type=${{ matrix.build_type }} -o bigfoot/*:build_tests=True -o bigfoot/*:build_benchmarks=True -o bigfoot/*:tracy=False -o bigfoot/*:vulkan=True
. ./build/${{ matrix.build_type }}/generators/conanbuild.sh
cmake -S . -B ./build/${{ matrix.build_type }} --toolchain ./build/${{ matrix.build_type }}/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_UNITY_BUILD=${{ matrix.unity_build }} -G "Ninja"
cmake --build build/${{ matrix.build_type }} --parallel $(nproc)
. ./build/${{ matrix.build_type }}/generators/deactivate_conanbuild.sh
conan install . --remote=bigfootpackages -pr:h=${{ matrix.conan_profile }} -pr:b=./ConanProfiles/build/clang --build=* -s build_type=${{ matrix.build_type }} -o bigfoot/*:build_tests=True -o bigfoot/*:build_benchmarks=True -o bigfoot/*:tracy=False -o bigfoot/*:vulkan=True -o bigfoot/*:toolmode=${{ matrix.toolmode }} -of build-${{ matrix.toolmode }}
. ./build-${{ matrix.toolmode }}/${{ matrix.build_type }}/generators/conanbuild.sh
cmake -S . -B ./build-${{ matrix.toolmode }}/${{ matrix.build_type }} --toolchain ./build-${{ matrix.toolmode }}/${{ matrix.build_type }}/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_UNITY_BUILD=${{ matrix.unity_build }} -G "Ninja"
cmake --build build-${{ matrix.toolmode }}/${{ matrix.build_type }} --parallel $(nproc)
. ./build-${{ matrix.toolmode }}/${{ matrix.build_type }}/generators/deactivate_conanbuild.sh
- name: Unit Tests
run: |
cd ./build/${{ matrix.build_type }}
. ../../build/${{ matrix.build_type }}/generators/conanbuild.sh
cd ./build-${{ matrix.toolmode }}/${{ matrix.build_type }}
. ../../build-${{ matrix.toolmode }}/${{ matrix.build_type }}/generators/conanbuild.sh
xvfb-run ctest . --output-on-failure
. ../../build/${{ matrix.build_type }}/generators/deactivate_conanbuild.sh
. ../../build-${{ matrix.toolmode }}/${{ matrix.build_type }}/generators/deactivate_conanbuild.sh
clang-format:
runs-on: ubuntu-latest
@@ -20,7 +20,7 @@
#define BIGFOOT_FLUSH_LOG \
do \
{ \
if (Bigfoot::Singleton<Bigfoot::Log>::HasInstance()) \
if (Bigfoot::Singleton<Bigfoot::Log>::HasInstance()) \
{ \
Bigfoot::Singleton<Bigfoot::Log>::GetInstance().Flush(); \
} \
@@ -26,4 +26,16 @@
#define BIGFOOT_NOT_OPTIMIZED_ONLY(...) __VA_ARGS__
#define BIGFOOT_OPTIMIZED_OR_NOT(p_optimized, p_notOptimized) p_notOptimized
#endif
#if defined BIGFOOT_TOOLMODE
#define BIGFOOT_TOOLMODE_ONLY(...) __VA_ARGS__
#define BIGFOOT_GAME_ONLY(...)
#define BIGFOOT_GAME_OR_TOOLMODE(p_game, p_toolmode) p_toolmode
#endif
#if defined BIGFOOT_GAME
#define BIGFOOT_TOOLMODE_ONLY(...)
#define BIGFOOT_GAME_ONLY(...) __VA_ARGS__
#define BIGFOOT_GAME_OR_TOOLMODE(p_game, p_toolmode) p_game
#endif
#endif
+9
View File
@@ -23,4 +23,13 @@ TEST_F(TargetMacrosFixture, OptimizedOrNot)
BIGFOOT_OPTIMIZED_ONLY(EXPECT_EQ(value, 1);)
}
/****************************************************************************************/
TEST_F(TargetMacrosFixture, GameOrToolmode)
{
constexpr std::uint32_t value = BIGFOOT_GAME_OR_TOOLMODE(1, 2);
BIGFOOT_GAME_ONLY(EXPECT_EQ(value, 1);)
BIGFOOT_TOOLMODE_ONLY(EXPECT_EQ(value, 2);)
}
} // namespace Bigfoot
+2 -1
View File
@@ -16,4 +16,5 @@ target_compile_definitions(BigfootCompileAndLinkFlags INTERFACE
$<$<PLATFORM_ID:Windows>:BIGFOOT_WINDOWS>
$<$<PLATFORM_ID:Linux>:BIGFOOT_LINUX>
$<$<CONFIG:Release>:BIGFOOT_OPTIMIZED>
$<$<CONFIG:Debug,RelWithDebInfo>:BIGFOOT_NOT_OPTIMIZED>)
$<$<CONFIG:Debug,RelWithDebInfo>:BIGFOOT_NOT_OPTIMIZED>
$<IF:$<BOOL:${TOOLMODE}>,BIGFOOT_TOOLMODE,BIGFOOT_GAME>)
+1
View File
@@ -18,6 +18,7 @@ option(ASAN OFF)
option(COVERAGE OFF)
option(TRACY ON)
option(VULKAN ON)
option(TOOLMODE ON)
set(AUTO_GENERATED_COMMENT "// AUTO-GENERATED DO NOT TOUCH")
+4 -1
View File
@@ -23,7 +23,8 @@ class Bigfoot(ConanFile):
"build_tests": [True, False],
"build_benchmarks": [True, False],
"tracy": [True, False],
"vulkan": [True, False]
"vulkan": [True, False],
"toolmode": [True, False]
}
default_options = {
"shared": False,
@@ -34,6 +35,7 @@ class Bigfoot(ConanFile):
"build_benchmarks": False,
"tracy": False,
"vulkan": True,
"toolmode": True,
}
generators = "CMakeDeps"
@@ -100,6 +102,7 @@ class Bigfoot(ConanFile):
tc.variables["BUILD_BENCHMARKS"] = self.options.build_benchmarks
tc.variables["TRACY"] = self.options.tracy
tc.variables["VULKAN"] = self.options.vulkan
tc.variables["TOOLMODE"] = self.options.toolmode
tc.generate()
+19 -13
View File
@@ -1,5 +1,5 @@
@echo off
setlocal
setlocal enabledelayedexpansion
REM ─── Validate argument ───────────────────────────────────────────────────────
if "%~1"=="force" set "build_option=--build=*" & goto :start
@@ -25,16 +25,20 @@ if errorlevel 1 (
)
REM ─── Shared flags ────────────────────────────────────────────────────────────
set "conan_common=--remote=bigfootpackages -pr:h=./ConanProfiles/host/msvc -pr:b=./ConanProfiles/build/msvc -of build-windows -o bigfoot/*:build_tests=True -o bigfoot/*:build_benchmarks=True -o bigfoot/*:tracy=True -o bigfoot/*:vulkan=True"
set "conan_common_base=--remote=bigfootpackages -pr:h=./ConanProfiles/host/msvc -pr:b=./ConanProfiles/build/msvc -o bigfoot/*:build_tests=True -o bigfoot/*:build_benchmarks=True -o bigfoot/*:tracy=True -o bigfoot/*:vulkan=True"
REM ─── Install dependencies for each build type ────────────────────────────────
REM ─── Install dependencies for each build type/variant ────────────────────────
for %%C in (Release RelWithDebInfo Debug) do (
echo.
echo [%%C] Installing dependencies...
conan install . %conan_common% %build_option% -s:h build_type=%%C
if errorlevel 1 (
echo ERROR: conan install failed for build type %%C
exit /b 1
for %%V in (toolmode game) do (
set "toolmode_val=False"
if "%%V"=="toolmode" set "toolmode_val=True"
conan install . !conan_common_base! -of build-windows-%%V -o bigfoot/*:toolmode=!toolmode_val! %build_option% -s:h build_type=%%C
if errorlevel 1 (
echo ERROR: conan install failed for build type %%C ^(%%V^)
exit /b 1
)
)
echo [%%C] Done.
)
@@ -45,16 +49,18 @@ echo All build types installed successfully.
REM ─── Activate build environment and run CMake ────────────────────────────────
echo.
echo Activating build environment and configuring CMake...
mkdir graphviz-windows 2>nul
powershell -ExecutionPolicy Bypass -Command "& 'build-windows/build/generators/conanbuild.ps1'; cmake -S . -B build-windows --toolchain build-windows/build/generators/conan_toolchain.cmake --graphviz=graphviz-windows/graph.dot; if ($LASTEXITCODE -ne 0) { Write-Host 'ERROR: CMake configuration failed'; exit 1 }"
for %%V in (toolmode game) do (
mkdir graphviz-windows-%%V 2>nul
if errorlevel 1 (
echo ERROR: Build environment or CMake step failed.
exit /b 1
powershell -ExecutionPolicy Bypass -Command "& 'build-windows-%%V/build/generators/conanbuild.ps1'; cmake -S . -B build-windows-%%V --toolchain build-windows-%%V/build/generators/conan_toolchain.cmake --graphviz=graphviz-windows-%%V/graph.dot; if ($LASTEXITCODE -ne 0) { Write-Host 'ERROR: CMake configuration failed'; exit 1 }"
if errorlevel 1 (
echo ERROR: Build environment or CMake step failed for %%V.
exit /b 1
)
)
echo.
echo CMake configuration successful.
endlocal
endlocal
+35 -15
View File
@@ -51,22 +51,39 @@ else
fi
# ─── Shared flags ─────────────────────────────────────────────────────────────
conan_common=(
conan_common_toolmode=(
--remote=bigfootpackages
-pr:h=./ConanProfiles/host/clang
-pr:b=./ConanProfiles/build/clang
-of build-linux
-of build-linux-toolmode
-o "bigfoot/*:build_tests=True"
-o "bigfoot/*:build_benchmarks=True"
-o "bigfoot/*:tracy=True"
-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 ─────────────────────────────────
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
if ! conan install . "${conan_common_toolmode[@]}" ${build_option} -s:h "build_type=${build_type}"; then
echo "ERROR: conan install failed for build type ${build_type}"
exit 1
fi
if ! conan install . "${conan_common_game[@]}" ${build_option} -s:h "build_type=${build_type}"; then
echo "ERROR: conan install failed for build type ${build_type}"
exit 1
fi
@@ -83,20 +100,23 @@ 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-linux/build/${build_type}/generators/conanbuild.sh"
mkdir -p "graphviz-linux/${build_type}"
for variant in toolmode game; do
# shellcheck disable=SC1090
source "build-linux-${variant}/build/${build_type}/generators/conanbuild.sh"
echo "[${build_type}] Running CMake..."
if ! cmake -S . -B "build-linux/${build_type}" \
--toolchain "build-linux/build/${build_type}/generators/conan_toolchain.cmake" \
-DCMAKE_BUILD_TYPE="${build_type}" \
-G "Ninja" \
--graphviz="graphviz-linux/${build_type}/graph.dot"; then
echo "ERROR: CMake configuration failed for build type ${build_type}."
exit 1
fi
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}" \
-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
-33
View File
@@ -1,33 +0,0 @@
@echo off
setlocal
REM Check if the correct number of arguments is provided
if "%~1"=="" (
echo Usage: %0 "[force|missing]"
exit /b 1
)
REM Set the build option based on the argument
set build_option=
if "%~1"=="force" (
set build_option=--build="*"
) else if "%~1"=="missing" (
set build_option=--build=missing
) else (
echo Invalid argument: %~1
echo Usage: %0 "[force|missing]"
exit /b 1
)
REM Add the remote
conan remote add bigfootpackages https://conan.romainboullard.com/artifactory/api/conan/BigfootPackages
REM Install the conan configuration
conan config install https://git.romainboullard.com/BigfootDev/ConanProfiles.git
REM Install dependencies with the specified build option
conan install . --deployer=full_deploy --remote=bigfootpackages -pr:h=msvc -pr:b=msvc %build_option% -of build -s build_type=Release -o bigfoot/*:build_tests=True -o bigfoot/*:tracy=True -o bigfoot/*:build_tools=True -o bigfoot/*:vulkan=True -o bigfoot/*:build_benchmarks=True
conan install . --deployer=full_deploy --remote=bigfootpackages -pr:h=msvcd -pr:b=msvcd %build_option% -of build -s build_type=RelWithDebInfo -o bigfoot/*:build_tests=True -o bigfoot/*:tracy=True -o bigfoot/*:build_tools=True -o bigfoot/*:vulkan=True -o bigfoot/*:build_benchmarks=True
conan install . --deployer=full_deploy --remote=bigfootpackages -pr:h=msvcd -pr:b=msvcd %build_option% -of build -s build_type=Debug -o bigfoot/*:build_tests=True -o bigfoot/*:tracy=True -o bigfoot/*:build_tools=True -o bigfoot/*:vulkan=True -o bigfoot/*:build_benchmarks=True
endlocal
-28
View File
@@ -1,28 +0,0 @@
#!/bin/bash
# Check if the correct number of arguments is provided
if [ -z "$1" ]; then
echo "Usage: $0 [force|missing]"
exit 1
fi
# Add the remote
conan remote add bigfootpackages https://conan.romainboullard.com/artifactory/api/conan/BigfootPackages
# Install the conan configuration
conan config install https://git.romainboullard.com/BigfootDev/ConanProfiles.git
# Set the build option based on the argument
if [ "$1" == "force" ]; then
conan install . --deployer=full_deploy --remote=bigfootpackages -pr:h=clang -pr:b=clang --build='*' -of build -s build_type=Release -o bigfoot/*:build_tests=True -o bigfoot/*:tracy=True -o bigfoot/*:build_tools=True -o bigfoot/*:vulkan=True -o bigfoot/*:build_benchmarks=True
conan install . --deployer=full_deploy --remote=bigfootpackages -pr:h=clangd -pr:b=clangd --build='*' -of build -s build_type=RelWithDebInfo -o bigfoot/*:build_tests=True -o bigfoot/*:tracy=True -o bigfoot/*:build_tools=True -o bigfoot/*:vulkan=True -o bigfoot/*:build_benchmarks=True
conan install . --deployer=full_deploy --remote=bigfootpackages -pr:h=clangd -pr:b=clangd --build='*' -of build -s build_type=Debug -o bigfoot/*:build_tests=True -o bigfoot/*:tracy=True -o bigfoot/*:build_tools=True -o bigfoot/*:vulkan=True -o bigfoot/*:build_benchmarks=True
elif [ "$1" == "missing" ]; then
conan install . --deployer=full_deploy --remote=bigfootpackages -pr:h=clang -pr:b=clang --build=missing -of build -s build_type=Release -o bigfoot/*:build_tests=True -o bigfoot/*:tracy=True -o bigfoot/*:build_tools=True -o bigfoot/*:vulkan=True -o bigfoot/*:build_benchmarks=True
conan install . --deployer=full_deploy --remote=bigfootpackages -pr:h=clangd -pr:b=clangd --build=missing -of build -s build_type=RelWithDebInfo -o bigfoot/*:build_tests=True -o bigfoot/*:tracy=True -o bigfoot/*:build_tools=True -o bigfoot/*:vulkan=True -o bigfoot/*:build_benchmarks=True
conan install . --deployer=full_deploy --remote=bigfootpackages -pr:h=clangd -pr:b=clangd --build=missing -of build -s build_type=Debug -o bigfoot/*:build_tests=True -o bigfoot/*:tracy=True -o bigfoot/*:build_tools=True -o bigfoot/*:vulkan=True -o bigfoot/*:build_benchmarks=True
else
echo "Invalid argument: $1"
echo "Usage: $0 [force|missing]"
exit 1
fi