From 037b93291dff979b40a99abfca65dcb716fabc3d Mon Sep 17 00:00:00 2001 From: Romain BOULLARD Date: Fri, 23 Jan 2026 17:36:05 +0100 Subject: [PATCH] Initial commit --- LICENSE | 21 +++++++++++++++++++++ profiles/clang | 26 ++++++++++++++++++++++++++ profiles/clang_dependencies | 24 ++++++++++++++++++++++++ profiles/clang_dependenciesd | 24 ++++++++++++++++++++++++ profiles/clang_unity | 26 ++++++++++++++++++++++++++ profiles/clang_unityd | 26 ++++++++++++++++++++++++++ profiles/clangd | 26 ++++++++++++++++++++++++++ profiles/gcc_coverage | 25 +++++++++++++++++++++++++ profiles/msvc | 23 +++++++++++++++++++++++ profiles/msvc_ccache.cmake | 19 +++++++++++++++++++ profiles/msvc_remove_ehsc.cmake | 1 + profiles/msvc_unity | 24 ++++++++++++++++++++++++ profiles/msvc_unityd | 24 ++++++++++++++++++++++++ profiles/msvcd | 23 +++++++++++++++++++++++ 14 files changed, 312 insertions(+) create mode 100644 LICENSE create mode 100644 profiles/clang create mode 100644 profiles/clang_dependencies create mode 100644 profiles/clang_dependenciesd create mode 100644 profiles/clang_unity create mode 100644 profiles/clang_unityd create mode 100644 profiles/clangd create mode 100644 profiles/gcc_coverage create mode 100644 profiles/msvc create mode 100644 profiles/msvc_ccache.cmake create mode 100644 profiles/msvc_remove_ehsc.cmake create mode 100644 profiles/msvc_unity create mode 100644 profiles/msvc_unityd create mode 100644 profiles/msvcd diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8268d51 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022-2023 Romain BOULLARD + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/profiles/clang b/profiles/clang new file mode 100644 index 0000000..6a783c2 --- /dev/null +++ b/profiles/clang @@ -0,0 +1,26 @@ +[settings] +os=Linux +arch=x86_64 +compiler=clang +compiler.version=18 +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: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"] +&:tools.build:cflags=["-flto", "-Wall", "-Wextra", "-Wpedantic", "-Werror", "-ffast-math"] +&:tools.build:cxxflags=["-flto", "-Wall", "-Wextra", "-Wpedantic", "-Werror", "-fno-exceptions", "-fno-rtti", "-ffast-math"] + +[tool_requires] +!cmake/*: cmake/[>=4.2] \ No newline at end of file diff --git a/profiles/clang_dependencies b/profiles/clang_dependencies new file mode 100644 index 0000000..d960e51 --- /dev/null +++ b/profiles/clang_dependencies @@ -0,0 +1,24 @@ +[settings] +os=Linux +arch=x86_64 +compiler=clang +compiler.version=18 +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: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/profiles/clang_dependenciesd b/profiles/clang_dependenciesd new file mode 100644 index 0000000..ac4333b --- /dev/null +++ b/profiles/clang_dependenciesd @@ -0,0 +1,24 @@ +[settings] +os=Linux +arch=x86_64 +compiler=clang +compiler.version=18 +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: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"] + +tools.build:cflags=[] +tools.build:cxxflags=[] + +[tool_requires] +!cmake/*: cmake/[>=4.2] \ No newline at end of file diff --git a/profiles/clang_unity b/profiles/clang_unity new file mode 100644 index 0000000..89cbe18 --- /dev/null +++ b/profiles/clang_unity @@ -0,0 +1,26 @@ +[settings] +os=Linux +arch=x86_64 +compiler=clang +compiler.version=18 +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', 'CMAKE_UNITY_BUILD': '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"] +&:tools.build:cflags=["-flto", "-Wall", "-Wextra", "-Wpedantic", "-Werror", "-ffast-math"] +&:tools.build:cxxflags=["-flto", "-Wall", "-Wextra", "-Wpedantic", "-Werror", "-fno-exceptions", "-fno-rtti", "-ffast-math"] + +[tool_requires] +!cmake/*: cmake/[>=4.2] \ No newline at end of file diff --git a/profiles/clang_unityd b/profiles/clang_unityd new file mode 100644 index 0000000..1f73e43 --- /dev/null +++ b/profiles/clang_unityd @@ -0,0 +1,26 @@ +[settings] +os=Linux +arch=x86_64 +compiler=clang +compiler.version=18 +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', 'CMAKE_UNITY_BUILD': '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"] + +tools.build:cflags=[] +tools.build:cxxflags=[] +&:tools.build:cflags=["-Wall", "-Wextra", "-Wpedantic", "-Werror", "-ffast-math"] +&:tools.build:cxxflags=["-Wall", "-Wextra", "-Wpedantic", "-Werror", "-fno-exceptions", "-fno-rtti", "-ffast-math"] + +[tool_requires] +!cmake/*: cmake/[>=4.2] \ No newline at end of file diff --git a/profiles/clangd b/profiles/clangd new file mode 100644 index 0000000..2ab6df7 --- /dev/null +++ b/profiles/clangd @@ -0,0 +1,26 @@ +[settings] +os=Linux +arch=x86_64 +compiler=clang +compiler.version=18 +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: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"] + +tools.build:cflags=[] +tools.build:cxxflags=[] +&:tools.build:cflags=["-Wall", "-Wextra", "-Wpedantic", "-Werror", "-ffast-math"] +&:tools.build:cxxflags=["-Wall", "-Wextra", "-Wpedantic", "-Werror", "-fno-exceptions", "-fno-rtti", "-ffast-math"] + +[tool_requires] +!cmake/*: cmake/[>=4.2] \ No newline at end of file diff --git a/profiles/gcc_coverage b/profiles/gcc_coverage new file mode 100644 index 0000000..cea2e40 --- /dev/null +++ b/profiles/gcc_coverage @@ -0,0 +1,25 @@ +[settings] +os=Linux +arch=x86_64 +compiler=gcc +compiler.version=13 +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:generator=Ninja +tools.system.package_manager:mode=install +tools.system.package_manager:sudo=True + +tools.build:exelinkflags=["--coverage"] +tools.build:sharedlinkflags=["--coverage"] + +tools.build:cflags=["-fprofile-abs-path", "--coverage", "-fno-inline-functions"] +tools.build:cxxflags=["-fprofile-abs-path", "--coverage", "-fno-inline-functions"] +&:tools.build:cflags=["-fprofile-abs-path", "--coverage", "-fno-inline-functions", "-Wall", "-Wextra", "-Wpedantic", "-Werror", "-ffast-math"] +&:tools.build:cxxflags=["-fprofile-abs-path", "--coverage", "-fno-inline-functions", "-Wall", "-Wextra", "-Wpedantic", "-Werror", "-fno-exceptions", "-fno-rtti", "-ffast-math"] + +[tool_requires] +!cmake/*: cmake/[>=4.2] \ No newline at end of file diff --git a/profiles/msvc b/profiles/msvc new file mode 100644 index 0000000..f85fa24 --- /dev/null +++ b/profiles/msvc @@ -0,0 +1,23 @@ +[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:user_toolchain+={{profile_dir}}/msvc_ccache.cmake +tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/msvc_remove_ehsc.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"] +&:tools.build:cflags=["/Zc:preprocessor", "/Zc:__STDC__", "/W4", "/WX", "/fp:fast", "/GL"] +&:tools.build:cxxflags=["/Zc:preprocessor", "/Zc:__cplusplus", "/Zc:enumTypes", "/Zc:templateScope", "/Zc:strictStrings", "/Zc:rvalueCast", "/Zc:hiddenFriend", "/Zc:externConstexpr", "/Zc:ternary", "/W4", "/WX", "/EHs-", "/D_HAS_EXCEPTIONS=0", "/GR-", "/fp:fast", "/GL"] + +[tool_requires] +!cmake/*: cmake/[>=4.2] \ No newline at end of file diff --git a/profiles/msvc_ccache.cmake b/profiles/msvc_ccache.cmake new file mode 100644 index 0000000..2818eec --- /dev/null +++ b/profiles/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/profiles/msvc_remove_ehsc.cmake b/profiles/msvc_remove_ehsc.cmake new file mode 100644 index 0000000..2a72261 --- /dev/null +++ b/profiles/msvc_remove_ehsc.cmake @@ -0,0 +1 @@ +string(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") \ No newline at end of file diff --git a/profiles/msvc_unity b/profiles/msvc_unity new file mode 100644 index 0000000..2714a60 --- /dev/null +++ b/profiles/msvc_unity @@ -0,0 +1,24 @@ +[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:user_toolchain+={{profile_dir}}/msvc_ccache.cmake +tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/msvc_remove_ehsc.cmake +tools.cmake.cmaketoolchain:extra_variables={'CMAKE_UNITY_BUILD': 'True'} + +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"] +&:tools.build:cflags=["/Zc:preprocessor", "/Zc:__STDC__", "/W4", "/WX", "/fp:fast", "/GL"] +&:tools.build:cxxflags=["/Zc:preprocessor", "/Zc:__cplusplus", "/Zc:enumTypes", "/Zc:templateScope", "/Zc:strictStrings", "/Zc:rvalueCast", "/Zc:hiddenFriend", "/Zc:externConstexpr", "/Zc:ternary", "/W4", "/WX", "/EHs-", "/D_HAS_EXCEPTIONS=0", "/GR-", "/fp:fast", "/GL"] + +[tool_requires] +!cmake/*: cmake/[>=4.2] \ No newline at end of file diff --git a/profiles/msvc_unityd b/profiles/msvc_unityd new file mode 100644 index 0000000..0dfe60d --- /dev/null +++ b/profiles/msvc_unityd @@ -0,0 +1,24 @@ +[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:user_toolchain+={{profile_dir}}/msvc_ccache.cmake +tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/msvc_remove_ehsc.cmake +tools.cmake.cmaketoolchain:extra_variables={'CMAKE_UNITY_BUILD': 'True'} + +tools.build:exelinkflags=[] +tools.build:sharedlinkflags=[] + +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"] +&:tools.build:cflags=["/Zc:preprocessor", "/Zc:__STDC__", "/W4", "/WX", "/fp:fast"] +&:tools.build:cxxflags=["/Zc:preprocessor", "/Zc:__cplusplus", "/Zc:enumTypes", "/Zc:templateScope", "/Zc:strictStrings", "/Zc:rvalueCast", "/Zc:hiddenFriend", "/Zc:externConstexpr", "/Zc:ternary", "/W4", "/WX", "/EHs-", "/D_HAS_EXCEPTIONS=0", "/GR-", "/fp:fast"] + +[tool_requires] +!cmake/*: cmake/[>=4.2] \ No newline at end of file diff --git a/profiles/msvcd b/profiles/msvcd new file mode 100644 index 0000000..deec227 --- /dev/null +++ b/profiles/msvcd @@ -0,0 +1,23 @@ +[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:user_toolchain+={{profile_dir}}/msvc_ccache.cmake +tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/msvc_remove_ehsc.cmake + +tools.build:exelinkflags=[] +tools.build:sharedlinkflags=[] + +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"] +&:tools.build:cflags=["/Zc:preprocessor", "/Zc:__STDC__", "/W4", "/WX", "/fp:fast"] +&:tools.build:cxxflags=["/Zc:preprocessor", "/Zc:__cplusplus", "/Zc:enumTypes", "/Zc:templateScope", "/Zc:strictStrings", "/Zc:rvalueCast", "/Zc:hiddenFriend", "/Zc:externConstexpr", "/Zc:ternary", "/W4", "/WX", "/EHs-", "/D_HAS_EXCEPTIONS=0", "/GR-", "/fp:fast"] + +[tool_requires] +!cmake/*: cmake/[>=4.2] \ No newline at end of file