From ab969451929a553f3aa42c9b63bd12b5d0696802 Mon Sep 17 00:00:00 2001 From: Romain BOULLARD Date: Fri, 20 Feb 2026 16:54:11 +0100 Subject: [PATCH] Use profiles from repo instead --- .gitea/workflows/ci.yml | 2 +- .gitea/workflows/sonarqube.yml | 2 +- ConanProfiles/clang | 26 ++++++++++++++++++++++++++ ConanProfiles/clang_coverage | 25 +++++++++++++++++++++++++ ConanProfiles/clangd | 23 +++++++++++++++++++++++ ConanProfiles/msvc | 22 ++++++++++++++++++++++ ConanProfiles/msvc_ccache.cmake | 19 +++++++++++++++++++ ConanProfiles/msvcd | 19 +++++++++++++++++++ generate_dependencies.bat | 9 +++------ generate_dependencies.sh | 15 ++++++--------- 10 files changed, 145 insertions(+), 17 deletions(-) create mode 100644 ConanProfiles/clang create mode 100644 ConanProfiles/clang_coverage create mode 100644 ConanProfiles/clangd create mode 100644 ConanProfiles/msvc create mode 100644 ConanProfiles/msvc_ccache.cmake create mode 100644 ConanProfiles/msvcd diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 8c52204..1b47f8e 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -34,7 +34,7 @@ jobs: - name: Build run: | - conan install . --deployer=full_deploy --deployer-folder=build --remote=bigfootpackages -pr:h=clang -pr:b=clang --build=missing -s build_type=${{ matrix.build_type }} -o bigfoot/*:build_tests=True -o bigfoot/*:tracy=False -o bigfoot/*:build_tools=True -o bigfoot/*:vulkan=True -o bigfoot/*:build_benchmarks=True + conan install . --deployer=full_deploy --deployer-folder=build --remote=bigfootpackages -pr:h=./ConanProfiles/clang -pr:b=./ConanProfiles/clang --build=missing -s build_type=${{ matrix.build_type }} -o bigfoot/*:build_tests=True -o bigfoot/*:tracy=False -o bigfoot/*:build_tools=True -o bigfoot/*:vulkan=True -o bigfoot/*:build_benchmarks=True 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) diff --git a/.gitea/workflows/sonarqube.yml b/.gitea/workflows/sonarqube.yml index 6e8c798..66a5500 100644 --- a/.gitea/workflows/sonarqube.yml +++ b/.gitea/workflows/sonarqube.yml @@ -25,7 +25,7 @@ jobs: - name: Generate run: | - conan install . --deployer=full_deploy --deployer-folder=build --remote=bigfootpackages -pr:h=clang_coverage -pr:b=clang_coverage --build=missing -s build_type=Debug -o bigfoot/*:build_tests=True -o bigfoot/*:tracy=False -o bigfoot/*:build_tools=True -o bigfoot/*:vulkan=True -o bigfoot/*:build_benchmarks=True + conan install . --deployer=full_deploy --deployer-folder=build --remote=bigfootpackages -pr:h=./ConanProfiles/clang_coverage -pr:b=./ConanProfiles/clang_coverage --build=missing -s build_type=Debug -o bigfoot/*:build_tests=True -o bigfoot/*:tracy=False -o bigfoot/*:build_tools=True -o bigfoot/*:vulkan=True -o bigfoot/*:build_benchmarks=True cmake -S . -B ./build/Debug --toolchain ./build/Debug/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Debug -G "Ninja" cmake --build build/Debug --parallel $(nproc) diff --git a/ConanProfiles/clang b/ConanProfiles/clang new file mode 100644 index 0000000..7e55968 --- /dev/null +++ b/ConanProfiles/clang @@ -0,0 +1,26 @@ +[settings] +os=Linux +arch=x86_64 +compiler=clang +compiler.version=20 +compiler.libcxx=libstdc++11 +compiler.cppstd=20 +compiler.cstd=17 +build_type=Release +[conf] +tools.cmake.cmaketoolchain:extra_variables={'CMAKE_CXX_COMPILER_LAUNCHER': 'ccache', 'CMAKE_C_COMPILER_LAUNCHER': 'ccache'} +tools.cmake.cmaketoolchain:extra_variables*={'BIGFOOT_CXX_FLAGS': {'value': '-Wall;-Wextra;-Wpedantic;-Werror;-ffast-math;-fno-exceptions;-fno-rtti', 'cache': True, 'type': 'STRING', 'docstring': 'CXX flags for Bigfoot', 'force': True}} +tools.cmake.cmaketoolchain:extra_variables*={'BIGFOOT_C_FLAGS': {'value': '-Wall;-Wextra;-Wpedantic;-Werror;-ffast-math', 'cache': True, 'type': 'STRING', 'docstring': 'C flags for Bigfoot', 'force': True}} +tools.cmake.cmaketoolchain:generator=Ninja +tools.system.package_manager:mode=install +tools.system.package_manager:sudo=True +tools.build:compiler_executables={"c": "clang", "cpp": "clang++"} + +tools.build:exelinkflags=["-fuse-ld=mold", "-flto"] +tools.build:sharedlinkflags=["-fuse-ld=mold", "-flto"] + +tools.build:cflags=["-flto"] +tools.build:cxxflags=["-flto"] + +[tool_requires] +!cmake/*: cmake/[>=4.2] \ No newline at end of file diff --git a/ConanProfiles/clang_coverage b/ConanProfiles/clang_coverage new file mode 100644 index 0000000..7e108a2 --- /dev/null +++ b/ConanProfiles/clang_coverage @@ -0,0 +1,25 @@ +[settings] +os=Linux +arch=x86_64 +compiler=clang +compiler.version=20 +compiler.libcxx=libstdc++11 +compiler.cppstd=20 +compiler.cstd=17 +build_type=Debug +[conf] +tools.cmake.cmaketoolchain:extra_variables={'CMAKE_CXX_COMPILER_LAUNCHER': 'ccache', 'CMAKE_C_COMPILER_LAUNCHER': 'ccache'} +tools.cmake.cmaketoolchain:extra_variables*={'BIGFOOT_CXX_FLAGS': {'value': '-Wall;-Wextra;-Wpedantic;-Werror;-fno-exceptions;-fno-rtti;-fprofile-instr-generate;-fcoverage-mapping', 'cache': True, 'type': 'STRING', 'docstring': 'CXX flags for Bigfoot', 'force': True}} +tools.cmake.cmaketoolchain:extra_variables*={'BIGFOOT_C_FLAGS': {'value': '-Wall;-Wextra;-Wpedantic;-Werror;-fprofile-instr-generate;-fcoverage-mapping', 'cache': True, 'type': 'STRING', 'docstring': 'C flags for Bigfoot', 'force': True}} +tools.cmake.cmaketoolchain:extra_variables*={'BIGFOOT_SHARED_LINK_FLAGS': {'value': '-fprofile-instr-generate', 'cache': True, 'type': 'STRING', 'docstring': 'SHARED link flags for Bigfoot', 'force': True}} +tools.cmake.cmaketoolchain:extra_variables*={'BIGFOOT_EXE_LINK_FLAGS': {'value': '-fprofile-instr-generate', 'cache': True, 'type': 'STRING', 'docstring': 'EXE link flags for Bigfoot', 'force': True}} +tools.cmake.cmaketoolchain:generator=Ninja +tools.system.package_manager:mode=install +tools.system.package_manager:sudo=True +tools.build:compiler_executables={"c": "clang", "cpp": "clang++"} + +tools.build:exelinkflags=["-fuse-ld=mold"] +tools.build:sharedlinkflags=["-fuse-ld=mold"] + +[tool_requires] +!cmake/*: cmake/[>=4.2] \ No newline at end of file diff --git a/ConanProfiles/clangd b/ConanProfiles/clangd new file mode 100644 index 0000000..5314e13 --- /dev/null +++ b/ConanProfiles/clangd @@ -0,0 +1,23 @@ +[settings] +os=Linux +arch=x86_64 +compiler=clang +compiler.version=20 +compiler.libcxx=libstdc++11 +compiler.cppstd=20 +compiler.cstd=17 +build_type=Debug +[conf] +tools.cmake.cmaketoolchain:extra_variables={'CMAKE_CXX_COMPILER_LAUNCHER': 'ccache', 'CMAKE_C_COMPILER_LAUNCHER': 'ccache'} +tools.cmake.cmaketoolchain:extra_variables*={'BIGFOOT_CXX_FLAGS': {'value': '-Wall;-Wextra;-Wpedantic;-Werror;-ffast-math;-fno-exceptions;-fno-rtti', 'cache': True, 'type': 'STRING', 'docstring': 'CXX flags for Bigfoot', 'force': True}} +tools.cmake.cmaketoolchain:extra_variables*={'BIGFOOT_C_FLAGS': {'value': '-Wall;-Wextra;-Wpedantic;-Werror;-ffast-math', 'cache': True, 'type': 'STRING', 'docstring': 'C flags for Bigfoot', 'force': True}} +tools.cmake.cmaketoolchain:generator=Ninja +tools.system.package_manager:mode=install +tools.system.package_manager:sudo=True +tools.build:compiler_executables={"c": "clang", "cpp": "clang++"} + +tools.build:exelinkflags=["-fuse-ld=mold"] +tools.build:sharedlinkflags=["-fuse-ld=mold"] + +[tool_requires] +!cmake/*: cmake/[>=4.2] \ No newline at end of file diff --git a/ConanProfiles/msvc b/ConanProfiles/msvc new file mode 100644 index 0000000..ba0a8c6 --- /dev/null +++ b/ConanProfiles/msvc @@ -0,0 +1,22 @@ +[settings] +os=Windows +arch=x86_64 +compiler=msvc +compiler.version=195 +compiler.cppstd=20 +compiler.cstd=17 +compiler.runtime=dynamic +build_type=Release +[conf] +tools.cmake.cmaketoolchain:extra_variables={'BIGFOOT_CXX_FLAGS': {'value': '/W4;/WX;/EHs-;/D_HAS_EXCEPTIONS=0;/GR-;/fp:fast', 'cache': True, 'type': 'STRING', 'docstring': 'CXX flags for Bigfoot', 'force': True}} +tools.cmake.cmaketoolchain:extra_variables*={'BIGFOOT_C_FLAGS': {'value': '/W4;/WX;/fp:fast', 'cache': True, 'type': 'STRING', 'docstring': 'C flags for Bigfoot', 'force': True}} +tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/msvc_ccache.cmake + +tools.build:exelinkflags=["/LTCG", "/INCREMENTAL:NO"] +tools.build:sharedlinkflags=["/LTCG", "/INCREMENTAL:NO"] + +tools.build:cflags=["/Zc:preprocessor", "/Zc:__STDC__", "/D_CRT_DECLARE_NONSTDC_NAMES=1", "/GL"] +tools.build:cxxflags=["/Zc:preprocessor", "/Zc:__cplusplus", "/Zc:enumTypes", "/Zc:templateScope", "/Zc:strictStrings", "/Zc:rvalueCast", "/Zc:hiddenFriend", "/Zc:externConstexpr", "/Zc:ternary", "/GL"] + +[tool_requires] +!cmake/*: cmake/[>=4.2] \ No newline at end of file diff --git a/ConanProfiles/msvc_ccache.cmake b/ConanProfiles/msvc_ccache.cmake new file mode 100644 index 0000000..2818eec --- /dev/null +++ b/ConanProfiles/msvc_ccache.cmake @@ -0,0 +1,19 @@ +# https://github.com/ccache/ccache/wiki/MS-Visual-Studio#usage-with-cmake + +find_program(ccache_exe ccache) +if(ccache_exe) + file(COPY_FILE + ${ccache_exe} ${CMAKE_BINARY_DIR}/cl.exe + ONLY_IF_DIFFERENT) + + # By default Visual Studio generators will use /Zi which is not compatible + # with ccache, so tell Visual Studio to use /Z7 instead. + message(STATUS "Setting MSVC debug information format to 'Embedded'") + set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$:Embedded>") + + set(CMAKE_VS_GLOBALS + "CLToolExe=cl.exe" + "CLToolPath=${CMAKE_BINARY_DIR}" + "UseMultiToolTask=true" + ) +endif() \ No newline at end of file diff --git a/ConanProfiles/msvcd b/ConanProfiles/msvcd new file mode 100644 index 0000000..1caf4c6 --- /dev/null +++ b/ConanProfiles/msvcd @@ -0,0 +1,19 @@ +[settings] +os=Windows +arch=x86_64 +compiler=msvc +compiler.version=195 +compiler.cppstd=20 +compiler.cstd=17 +compiler.runtime=dynamic +build_type=Debug +[conf] +tools.cmake.cmaketoolchain:extra_variables={'BIGFOOT_CXX_FLAGS': {'value': '/W4;/WX;/EHs-;/D_HAS_EXCEPTIONS=0;/GR-;/fp:fast', 'cache': True, 'type': 'STRING', 'docstring': 'CXX flags for Bigfoot', 'force': True}} +tools.cmake.cmaketoolchain:extra_variables*={'BIGFOOT_C_FLAGS': {'value': '/W4;/WX;/fp:fast', 'cache': True, 'type': 'STRING', 'docstring': 'C flags for Bigfoot', 'force': True}} +tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/msvc_ccache.cmake + +tools.build:cflags=["/Zc:preprocessor", "/Zc:__STDC__", "/D_CRT_DECLARE_NONSTDC_NAMES=1"] +tools.build:cxxflags=["/Zc:preprocessor", "/Zc:__cplusplus", "/Zc:enumTypes", "/Zc:templateScope", "/Zc:strictStrings", "/Zc:rvalueCast", "/Zc:hiddenFriend", "/Zc:externConstexpr", "/Zc:ternary"] + +[tool_requires] +!cmake/*: cmake/[>=4.2] \ No newline at end of file diff --git a/generate_dependencies.bat b/generate_dependencies.bat index f7de8c6..b4b1ffd 100644 --- a/generate_dependencies.bat +++ b/generate_dependencies.bat @@ -22,12 +22,9 @@ if "%~1"=="force" ( 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 +conan install . --deployer=full_deploy --remote=bigfootpackages -pr:h=./ConanProfiles/msvc -pr:b=./ConanProfiles/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=./ConanProfiles/msvcd -pr:b=./ConanProfiles/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=./ConanProfiles/msvcd -pr:b=./ConanProfiles/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 diff --git a/generate_dependencies.sh b/generate_dependencies.sh index 6d90476..22227a5 100644 --- a/generate_dependencies.sh +++ b/generate_dependencies.sh @@ -9,18 +9,15 @@ 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 + conan install . --deployer=full_deploy --remote=bigfootpackages -pr:h=./ConanProfiles/clang -pr:b=./ConanProfiles/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=./ConanProfiles/clangd -pr:b=./ConanProfiles/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=./ConanProfiles/clangd -pr:b=./ConanProfiles/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 + conan install . --deployer=full_deploy --remote=bigfootpackages -pr:h=./ConanProfiles/clang -pr:b=./ConanProfiles/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=./ConanProfiles/clangd -pr:b=./ConanProfiles/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=./ConanProfiles/clangd -pr:b=./ConanProfiles/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]"