diff --git a/ConanProfiles/Tools/clang b/ConanProfiles/Tools/clang index 4b8f8d3..45bd6b6 100644 --- a/ConanProfiles/Tools/clang +++ b/ConanProfiles/Tools/clang @@ -25,4 +25,7 @@ tools.build:compiler_executables={"c": "clang", "cpp": "clang++"} tools.cmake.cmaketoolchain:generator=Ninja [tool_requires] -!cmake/*: cmake/[>=4.2] \ No newline at end of file +!cmake/*: cmake/4.3.2 + +[buildenv] +CCACHE_NOHASHDIR=1 \ No newline at end of file diff --git a/ConanProfiles/Tools/msvc b/ConanProfiles/Tools/msvc index 0925241..ec09115 100644 --- a/ConanProfiles/Tools/msvc +++ b/ConanProfiles/Tools/msvc @@ -16,5 +16,10 @@ tools.meson.mesontoolchain:extra_machine_files+={{profile_dir}}/../Toolchains/ip tools.build:cflags=["/Zc:preprocessor", "/Zc:__STDC__", "/D_CRT_DECLARE_NONSTDC_NAMES=1"] tools.build:cxxflags=["/Zc:preprocessor", "/permissive-", "/Zc:__cplusplus", "/Zc:enumTypes", "/Zc:templateScope"] +tools.env.virtualenv:powershell=powershell.exe + [tool_requires] -!cmake/*: cmake/[>=4.2] \ No newline at end of file +!cmake/*: cmake/4.3.2 + +[buildenv] +CCACHE_NOHASHDIR=1 \ No newline at end of file diff --git a/ConanProfiles/clang b/ConanProfiles/clang index ea0186d..bd370f2 100644 --- a/ConanProfiles/clang +++ b/ConanProfiles/clang @@ -27,7 +27,10 @@ tools.build:compiler_executables={"c": "clang", "cpp": "clang++"} tools.cmake.cmaketoolchain:generator=Ninja [tool_requires] -!cmake/*: cmake/[>=4.2] +!cmake/*: cmake/4.3.2 [options] -bigfoot/*:build_tests=True \ No newline at end of file +bigfoot/*:build_tests=True + +[buildenv] +CCACHE_NOHASHDIR=1 \ No newline at end of file diff --git a/ConanProfiles/clang_asan b/ConanProfiles/clang_asan index 30be511..2bedb0d 100644 --- a/ConanProfiles/clang_asan +++ b/ConanProfiles/clang_asan @@ -26,8 +26,11 @@ tools.cmake.cmaketoolchain:generator=Ninja tools.build:compiler_executables={"c": "clang", "cpp": "clang++"} [tool_requires] -!cmake/*: cmake/[>=4.2] +!cmake/*: cmake/4.3.2 [options] bigfoot/*:asan=True -bigfoot/*:build_tests=True \ No newline at end of file +bigfoot/*:build_tests=True + +[buildenv] +CCACHE_NOHASHDIR=1 \ No newline at end of file diff --git a/ConanProfiles/clang_coverage b/ConanProfiles/clang_coverage index f813e75..7e86b66 100644 --- a/ConanProfiles/clang_coverage +++ b/ConanProfiles/clang_coverage @@ -25,8 +25,11 @@ tools.cmake.cmaketoolchain:generator=Ninja tools.build:compiler_executables={"c": "clang", "cpp": "clang++"} [tool_requires] -!cmake/*: cmake/[>=4.2] +!cmake/*: cmake/4.3.2 [options] bigfoot/*:build_tests=True bigfoot/*:coverage=True + +[buildenv] +CCACHE_NOHASHDIR=1 \ No newline at end of file diff --git a/ConanProfiles/msvc b/ConanProfiles/msvc index 7326abe..c0076f3 100644 --- a/ConanProfiles/msvc +++ b/ConanProfiles/msvc @@ -18,8 +18,13 @@ tools.build:cxxflags=["/Zc:preprocessor", "/permissive-", "/Zc:__cplusplus", "/Z tools.build:defines=["_HAS_EXCEPTIONS=0"] +tools.env.virtualenv:powershell=powershell.exe + [tool_requires] -!cmake/*: cmake/[>=4.2] +!cmake/*: cmake/4.3.2 [options] -bigfoot/*:build_tests=True \ No newline at end of file +bigfoot/*:build_tests=True + +[buildenv] +CCACHE_NOHASHDIR=1 \ No newline at end of file diff --git a/ConanProfiles/msvc_asan b/ConanProfiles/msvc_asan index cc2e6b9..6af525a 100644 --- a/ConanProfiles/msvc_asan +++ b/ConanProfiles/msvc_asan @@ -16,9 +16,14 @@ tools.build:cxxflags=["/Zc:preprocessor", "/permissive-", "/Zc:__cplusplus", "/Z tools.build:defines=["_HAS_EXCEPTIONS=0"] +tools.env.virtualenv:powershell=powershell.exe + [tool_requires] -!cmake/*: cmake/[>=4.2] +!cmake/*: cmake/4.3.2 [options] bigfoot/*:asan=True bigfoot/*:build_tests=True + +[buildenv] +CCACHE_NOHASHDIR=1 diff --git a/generate_bigfoot.bat b/generate_bigfoot.bat index 0f4298f..7847c21 100644 --- a/generate_bigfoot.bat +++ b/generate_bigfoot.bat @@ -1 +1,60 @@ -cmake -S . -B build --toolchain build/generators/conan_toolchain.cmake --graphviz=graphviz/graph.dot \ No newline at end of file +@echo off +setlocal + +REM ─── Validate argument ─────────────────────────────────────────────────────── +if "%~1"=="force" set "build_option=--build=*" & goto :start +if "%~1"=="missing" set "build_option=--build=missing" & goto :start + +echo Usage: %~n0 [force^|missing] +echo force - Rebuild all packages from source +echo missing - Only build packages not already cached +exit /b 1 + +:start +REM ─── Register remote (skip if already registered) ──────────────────────────── +conan remote list | findstr /i "bigfootpackages" >nul 2>&1 +if errorlevel 1 ( + echo Adding Conan remote: bigfootpackages + conan remote add bigfootpackages https://conan.romainboullard.com/artifactory/api/conan/BigfootPackages + if errorlevel 1 ( + echo ERROR: Failed to add Conan remote. + exit /b 1 + ) +) else ( + echo Conan remote 'bigfootpackages' already registered, skipping. +) + +REM ─── Shared flags ──────────────────────────────────────────────────────────── +set "conan_common=--remote=bigfootpackages -pr:h=./ConanProfiles/msvc -pr:b=./ConanProfiles/Tools/msvc -of build -o bigfoot/*:build_tests=True -o bigfoot/*:tracy=True -o bigfoot/*:vulkan=True" + +REM ─── Install dependencies for each build type ──────────────────────────────── +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 + ) + echo [%%C] Done. +) + +echo. +echo All build types installed successfully. + +REM ─── Activate build environment and run CMake ──────────────────────────────── +echo. +echo Activating build environment and configuring CMake... +mkdir graphviz 2>nul + +powershell -ExecutionPolicy Bypass -Command "& 'build/build/generators/conanbuild.ps1'; cmake -S . -B build --toolchain build/build/generators/conan_toolchain.cmake --graphviz=graphviz/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. + exit /b 1 +) + +echo. +echo CMake configuration successful. + +endlocal \ No newline at end of file diff --git a/generate_dependencies.bat b/generate_dependencies.bat deleted file mode 100644 index 6551366..0000000 --- a/generate_dependencies.bat +++ /dev/null @@ -1,30 +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 dependencies with the specified build option -conan install . --remote=bigfootpackages -pr:h=./ConanProfiles/msvc -pr:b=./ConanProfiles/Tools/msvc %build_option% -of build -s build_type=Release -o bigfoot/*:build_tests=True -o bigfoot/*:tracy=True -o bigfoot/*:vulkan=True -conan install . --remote=bigfootpackages -pr:h=./ConanProfiles/msvc -pr:b=./ConanProfiles/Tools/msvc %build_option% -of build -s build_type=RelWithDebInfo -o bigfoot/*:build_tests=True -o bigfoot/*:tracy=True -o bigfoot/*:vulkan=True -conan install . --remote=bigfootpackages -pr:h=./ConanProfiles/msvc -pr:b=./ConanProfiles/Tools/msvc %build_option% -of build -s build_type=Debug -o bigfoot/*:build_tests=True -o bigfoot/*:tracy=True -o bigfoot/*:vulkan=True - -endlocal diff --git a/generate_dependencies.sh b/generate_dependencies.sh index 9b48fac..bb82439 100644 --- a/generate_dependencies.sh +++ b/generate_dependencies.sh @@ -1,25 +1,45 @@ #!/bin/bash -# Check if the correct number of arguments is provided -if [ -z "$1" ]; then +# ─── Validate argument ─────────────────────────────────────────────────────── +usage() { echo "Usage: $0 [force|missing]" + echo " force - Rebuild all packages from source" + echo " missing - Only build packages not already cached" exit 1 -fi +} -# Add the remote -conan remote add bigfootpackages https://conan.romainboullard.com/artifactory/api/conan/BigfootPackages - -# Set the build option based on the argument -if [ "$1" == "force" ]; then - conan install . --remote=bigfootpackages -pr:h=./ConanProfiles/clang -pr:b=./ConanProfiles/Tools/clang --build='*' -of build -s build_type=Release -o bigfoot/*:build_tests=True -o bigfoot/*:tracy=True -o bigfoot/*:vulkan=True - conan install . --remote=bigfootpackages -pr:h=./ConanProfiles/clang -pr:b=./ConanProfiles/Tools/clang --build='*' -of build -s build_type=RelWithDebInfo -o bigfoot/*:build_tests=True -o bigfoot/*:tracy=True -o bigfoot/*:vulkan=True - conan install . --remote=bigfootpackages -pr:h=./ConanProfiles/clang -pr:b=./ConanProfiles/Tools/clang --build='*' -of build -s build_type=Debug -o bigfoot/*:build_tests=True -o bigfoot/*:tracy=True -o bigfoot/*:vulkan=True +if [ -z "$1" ]; then + usage +elif [ "$1" == "force" ]; then + build_option="--build=*" elif [ "$1" == "missing" ]; then - conan install . --remote=bigfootpackages -pr:h=./ConanProfiles/clang -pr:b=./ConanProfiles/Tools/clang --build=missing -of build -s build_type=Release -o bigfoot/*:build_tests=True -o bigfoot/*:tracy=True -o bigfoot/*:vulkan=True - conan install . --remote=bigfootpackages -pr:h=./ConanProfiles/clang -pr:b=./ConanProfiles/Tools/clang --build=missing -of build -s build_type=RelWithDebInfo -o bigfoot/*:build_tests=True -o bigfoot/*:tracy=True -o bigfoot/*:vulkan=True - conan install . --remote=bigfootpackages -pr:h=./ConanProfiles/clang -pr:b=./ConanProfiles/Tools/clang --build=missing -of build -s build_type=Debug -o bigfoot/*:build_tests=True -o bigfoot/*:tracy=True -o bigfoot/*:vulkan=True + build_option="--build=missing" else echo "Invalid argument: $1" - echo "Usage: $0 [force|missing]" - exit 1 + usage fi + +# ─── Register remote (skip if already registered) ──────────────────────────── +if ! conan remote list | grep -qi "bigfootpackages"; then + echo "Adding Conan remote: bigfootpackages" + conan remote add bigfootpackages https://conan.romainboullard.com/artifactory/api/conan/BigfootPackages || exit 1 +else + echo "Conan remote 'bigfootpackages' already registered, skipping." +fi + +# ─── Shared flags ──────────────────────────────────────────────────────────── +conan_common="--remote=bigfootpackages -pr:h=./ConanProfiles/clang -pr:b=./ConanProfiles/Tools/clang -of build -o bigfoot/*:build_tests=True -o bigfoot/*:tracy=True -o bigfoot/*:vulkan=True" + +# ─── Install dependencies for each build type ──────────────────────────────── +for build_type in Release RelWithDebInfo Debug; do + echo "" + echo "[$build_type] Installing dependencies..." + conan install . $conan_common $build_option -s build_type=$build_type || { + echo "ERROR: conan install failed for build type $build_type" + exit 1 + } + echo "[$build_type] Done." +done + +echo "" +echo "All build types installed successfully." \ No newline at end of file