Maintenance (#7)
All checks were successful
Bin2CPP / Build & Test Debug with ./ConanProfiles/clang (Unity Build: OFF) (push) Successful in 40s
Bin2CPP / Build & Test Debug with ./ConanProfiles/clang (Unity Build: ON) (push) Successful in 41s
Bin2CPP / Build & Test Debug with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Successful in 47s
Bin2CPP / Build & Test Release with ./ConanProfiles/clang (Unity Build: OFF) (push) Successful in 51s
Bin2CPP / Build & Test Debug with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Successful in 49s
Bin2CPP / Build & Test RelWithDebInfo with ./ConanProfiles/clang (Unity Build: OFF) (push) Successful in 56s
Bin2CPP / Build & Test RelWithDebInfo with ./ConanProfiles/clang (Unity Build: ON) (push) Successful in 55s
Bin2CPP / Build & Test RelWithDebInfo with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Successful in 1m11s
Bin2CPP / Build & Test RelWithDebInfo with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Successful in 1m15s
Bin2CPP / Sonarqube (push) Successful in 1m9s
Bin2CPP / Build & Test Release with ./ConanProfiles/clang (Unity Build: ON) (push) Successful in 50s
Bin2CPP / Build & Test Release with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Successful in 1m6s
Bin2CPP / Build & Test Release with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Successful in 1m9s
Bin2CPP / Clang Format Checks (push) Successful in 8s
Conan Packaging / Package Bin2CPP/1.0.0 (push) Successful in 53s

Reviewed-on: #7
This commit was merged in pull request #7.
This commit is contained in:
2026-04-17 10:01:48 +00:00
parent 00f512d7b1
commit 04923344bc
20 changed files with 124 additions and 124 deletions

View File

@@ -0,0 +1,30 @@
include_guard()
# Find ccache executable
find_program(CCACHE_PROGRAM NAMES ccache)
if(CCACHE_PROGRAM)
message(STATUS "ccache found: ${CCACHE_PROGRAM}, enabling via CMake launcher and environment.")
if (CMAKE_GENERATOR MATCHES "Visual Studio")
# Copy original ccache.exe and rename to cl.exe, this way intermediate cmd file is not needed
file(COPY_FILE ${CCACHE_PROGRAM} ${CMAKE_BINARY_DIR}/cl.exe ONLY_IF_DIFFERENT)
# Set Visual Studio global variables:
# - Use above cl.exe (ccache.exe) as a compiler
# - Enable parallel compilation
list(APPEND CMAKE_VS_GLOBALS
"CLToolExe=cl.exe"
"CLToolPath=${CMAKE_BINARY_DIR}"
"UseMultiToolTask=true"
"UseStructuredOutput=false"
)
elseif(CMAKE_GENERATOR MATCHES "Ninja" OR CMAKE_GENERATOR MATCHES "Unix Makefiles")
message(STATUS "Using ccache as compiler launcher for Ninja or Makefiles.")
set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_PROGRAM} CACHE FILEPATH "CXX compiler cache used" FORCE)
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_PROGRAM} CACHE FILEPATH "C compiler cache used" FORCE)
else()
message(WARNING "Unsupported generator for ccache integration: ${CMAKE_GENERATOR}. ccache will not be used.")
endif()
else()
message(WARNING "ccache not found. Not enabling ccache integration.")
endif()

View File

@@ -0,0 +1,5 @@
include_guard()
set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE)

View File

@@ -0,0 +1,2 @@
[built-in options]
b_lto = true

View File

@@ -10,16 +10,15 @@ compiler.runtime=static
build_type=Release
[conf]
tools.cmake.cmaketoolchain:extra_variables={'CMAKE_CXX_COMPILER_LAUNCHER': 'ccache', 'CMAKE_C_COMPILER_LAUNCHER': 'ccache'}
tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/Toolchains/ccache.cmake
tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/Toolchains/ipo.cmake
tools.meson.mesontoolchain:extra_machine_files+={{profile_dir}}/Toolchains/ipo.ini
tools.system.package_manager:mode=install
tools.system.package_manager:sudo=True
tools.build:exelinkflags=["-fuse-ld=mold", "-flto"]
tools.build:sharedlinkflags=["-fuse-ld=mold", "-flto"]
tools.build:cflags=["-flto"]
tools.build:cxxflags=["-flto"]
tools.build:exelinkflags=["-fuse-ld=mold"]
tools.build:sharedlinkflags=["-fuse-ld=mold"]
tools.build:compiler_executables={"c": "clang", "cpp": "clang++"}

View File

@@ -10,7 +10,7 @@ compiler.runtime=static
build_type=Debug
[conf]
tools.cmake.cmaketoolchain:extra_variables={'CMAKE_CXX_COMPILER_LAUNCHER': 'ccache', 'CMAKE_C_COMPILER_LAUNCHER': 'ccache'}
tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/Toolchains/ccache.cmake
tools.system.package_manager:mode=install
tools.system.package_manager:sudo=True

View File

@@ -10,7 +10,7 @@ compiler.runtime=static
build_type=Debug
[conf]
tools.cmake.cmaketoolchain:extra_variables={'CMAKE_CXX_COMPILER_LAUNCHER': 'ccache', 'CMAKE_C_COMPILER_LAUNCHER': 'ccache'}
tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/Toolchains/ccache.cmake
tools.system.package_manager:mode=install
tools.system.package_manager:sudo=True

View File

@@ -1,29 +0,0 @@
[settings]
os=Linux
arch=x86_64
compiler=clang
compiler.version=20
compiler.libcxx=libstdc++11
compiler.cppstd=20
compiler.cstd=17
compiler.runtime=static
build_type=Debug
[conf]
tools.cmake.cmaketoolchain:extra_variables={'CMAKE_CXX_COMPILER_LAUNCHER': 'ccache', 'CMAKE_C_COMPILER_LAUNCHER': 'ccache'}
tools.system.package_manager:mode=install
tools.system.package_manager:sudo=True
tools.build:exelinkflags=["-fuse-ld=mold"]
tools.build:sharedlinkflags=["-fuse-ld=mold"]
tools.cmake.cmaketoolchain:generator=Ninja
tools.build:compiler_executables={"c": "clang", "cpp": "clang++"}
[tool_requires]
!cmake/*: cmake/[>=4.2]
[options]
bin2cpp/*:build_tests=True

View File

@@ -9,12 +9,11 @@ compiler.runtime=static
build_type=Release
[conf]
tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/msvc_ccache.cmake
tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/Toolchains/ccache.cmake
tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/Toolchains/ipo.cmake
tools.meson.mesontoolchain:extra_machine_files+={{profile_dir}}/Toolchains/ipo.ini
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:cflags=["/Zc:preprocessor", "/Zc:__STDC__", "/D_CRT_DECLARE_NONSTDC_NAMES=1"]
tools.build:cxxflags=["/Zc:preprocessor", "/permissive-", "/Zc:__cplusplus", "/Zc:enumTypes", "/Zc:templateScope", "/Zc:throwingNew"]
[tool_requires]

View File

@@ -9,10 +9,7 @@ compiler.runtime=static
build_type=Debug
[conf]
tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/msvc_ccache.cmake
tools.build:exelinkflags=["/INCREMENTAL:NO"]
tools.build:sharedlinkflags=["/INCREMENTAL:NO"]
tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/Toolchains/ccache.cmake
tools.build:cflags=["/Zc:preprocessor", "/Zc:__STDC__", "/D_CRT_DECLARE_NONSTDC_NAMES=1", "/fsanitize=address"]
tools.build:cxxflags=["/Zc:preprocessor", "/permissive-", "/Zc:__cplusplus", "/Zc:enumTypes", "/Zc:templateScope", "/Zc:throwingNew", "/fsanitize=address"]

View File

@@ -1,19 +0,0 @@
# 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 "$<$<CONFIG:Debug,RelWithDebInfo>:Embedded>")
set(CMAKE_VS_GLOBALS
"CLToolExe=cl.exe"
"CLToolPath=${CMAKE_BINARY_DIR}"
"UseMultiToolTask=true"
)
endif()

View File

@@ -1,20 +0,0 @@
[settings]
os=Windows
arch=x86_64
compiler=msvc
compiler.version=195
compiler.cppstd=20
compiler.cstd=17
compiler.runtime=static
build_type=Debug
[conf]
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", "/permissive-", "/Zc:__cplusplus", "/Zc:enumTypes", "/Zc:templateScope", "/Zc:throwingNew"]
[tool_requires]
!cmake/*: cmake/[>=4.2]
[options]
bin2cpp/*:build_tests=True