No CPPTrace (#8)
All checks were successful
Bin2CPP / Build & Test Debug with ./ConanProfiles/clang (Unity Build: OFF) (push) Successful in 4m36s
Bin2CPP / Build & Test Debug with ./ConanProfiles/clang (Unity Build: ON) (push) Successful in 4m39s
Bin2CPP / Build & Test Debug with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Successful in 4m42s
Bin2CPP / Build & Test Debug with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Successful in 4m38s
Bin2CPP / Build & Test RelWithDebInfo with ./ConanProfiles/clang (Unity Build: OFF) (push) Successful in 4m51s
Bin2CPP / Build & Test RelWithDebInfo with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Successful in 4m59s
Conan Packaging / Package Bin2CPP/1.0.0 (push) Successful in 4m45s
Bin2CPP / Build & Test RelWithDebInfo with ./ConanProfiles/clang (Unity Build: ON) (push) Successful in 4m49s
Bin2CPP / Build & Test RelWithDebInfo with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Successful in 4m53s
Bin2CPP / Build & Test Release with ./ConanProfiles/clang (Unity Build: OFF) (push) Successful in 4m42s
Bin2CPP / Build & Test Release with ./ConanProfiles/clang (Unity Build: ON) (push) Successful in 4m46s
Bin2CPP / Build & Test Release with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Successful in 4m53s
Bin2CPP / Build & Test Release with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Successful in 4m51s
Bin2CPP / Clang Format Checks (push) Successful in 9s
Bin2CPP / Sonarqube (push) Successful in 5m8s
All checks were successful
Bin2CPP / Build & Test Debug with ./ConanProfiles/clang (Unity Build: OFF) (push) Successful in 4m36s
Bin2CPP / Build & Test Debug with ./ConanProfiles/clang (Unity Build: ON) (push) Successful in 4m39s
Bin2CPP / Build & Test Debug with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Successful in 4m42s
Bin2CPP / Build & Test Debug with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Successful in 4m38s
Bin2CPP / Build & Test RelWithDebInfo with ./ConanProfiles/clang (Unity Build: OFF) (push) Successful in 4m51s
Bin2CPP / Build & Test RelWithDebInfo with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Successful in 4m59s
Conan Packaging / Package Bin2CPP/1.0.0 (push) Successful in 4m45s
Bin2CPP / Build & Test RelWithDebInfo with ./ConanProfiles/clang (Unity Build: ON) (push) Successful in 4m49s
Bin2CPP / Build & Test RelWithDebInfo with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Successful in 4m53s
Bin2CPP / Build & Test Release with ./ConanProfiles/clang (Unity Build: OFF) (push) Successful in 4m42s
Bin2CPP / Build & Test Release with ./ConanProfiles/clang (Unity Build: ON) (push) Successful in 4m46s
Bin2CPP / Build & Test Release with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Successful in 4m53s
Bin2CPP / Build & Test Release with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Successful in 4m51s
Bin2CPP / Clang Format Checks (push) Successful in 9s
Bin2CPP / Sonarqube (push) Successful in 5m8s
Reviewed-on: #8 Co-authored-by: Romain BOULLARD <romain.boullard@protonmail.com> Co-committed-by: Romain BOULLARD <romain.boullard@protonmail.com>
This commit was merged in pull request #8.
This commit is contained in:
@@ -6,13 +6,6 @@ on:
|
|||||||
- '**'
|
- '**'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
env:
|
|
||||||
CCACHE_DIR: /ccache
|
|
||||||
CCACHE_MAXSIZE: 10G
|
|
||||||
CCACHE_BASEDIR: /root/.conan2
|
|
||||||
CCACHE_NOHASHDIR: "true"
|
|
||||||
CCACHE_COMPILERCHECK: "%compiler% -dumpversion"
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-test:
|
build-and-test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -36,9 +29,11 @@ jobs:
|
|||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
conan install . --remote=bigfootpackages -pr:h=${{ matrix.conan_profile }} -pr:b=${{ matrix.conan_profile }} --build=missing -s build_type=${{ matrix.build_type }} -o bin2cpp/*:build_tests=True
|
conan install . --remote=bigfootpackages -pr:h=${{ matrix.conan_profile }} -pr:b=./ConanProfiles/Tools/clang --build=* -s:h build_type=${{ matrix.build_type }}
|
||||||
|
. ./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 -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)
|
cmake --build build/${{ matrix.build_type }} --parallel $(nproc)
|
||||||
|
. ./build/${{ matrix.build_type }}/generators/deactivate_conanbuild.sh
|
||||||
|
|
||||||
- name: Unit Tests
|
- name: Unit Tests
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -6,13 +6,6 @@ on:
|
|||||||
- '**'
|
- '**'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
env:
|
|
||||||
CCACHE_DIR: /ccache
|
|
||||||
CCACHE_MAXSIZE: 10G
|
|
||||||
CCACHE_BASEDIR: /root/.conan2
|
|
||||||
CCACHE_NOHASHDIR: "true"
|
|
||||||
CCACHE_COMPILERCHECK: "%compiler% -dumpversion"
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
conan-packages:
|
conan-packages:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -35,9 +28,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Show ccache stats before
|
|
||||||
run: ccache --zero-stats
|
|
||||||
|
|
||||||
- name: Run Conan packaging
|
- name: Run Conan packaging
|
||||||
run: |
|
run: |
|
||||||
echo "Building Bin2CPP@$1.0.0"
|
echo "Building Bin2CPP@$1.0.0"
|
||||||
@@ -47,13 +37,10 @@ jobs:
|
|||||||
--version=1.0.0 \
|
--version=1.0.0 \
|
||||||
--user=bigfootdev \
|
--user=bigfootdev \
|
||||||
--channel=${{ env.BRANCH_NAME }} \
|
--channel=${{ env.BRANCH_NAME }} \
|
||||||
-pr:b=./ConanProfiles/clang -pr:h=./ConanProfiles/clang \
|
-pr:b=./ConanProfiles/Tools/clang -pr:h=./ConanProfiles/clang \
|
||||||
--build=missing --remote=bigfootpackages
|
--build=* --remote=bigfootpackages
|
||||||
|
|
||||||
CONAN_LOGIN_USERNAME=${ARTIFACTORY_USER} \
|
CONAN_LOGIN_USERNAME=${ARTIFACTORY_USER} \
|
||||||
CONAN_PASSWORD=${ARTIFACTORY_PASSWORD} \
|
CONAN_PASSWORD=${ARTIFACTORY_PASSWORD} \
|
||||||
conan upload bin2cpp/1.0.0@bigfootdev/${{ env.BRANCH_NAME }} \
|
conan upload bin2cpp/1.0.0@bigfootdev/${{ env.BRANCH_NAME }} \
|
||||||
--only-recipe --remote=bigfootpackages
|
--only-recipe --remote=bigfootpackages
|
||||||
|
|
||||||
- name: Show ccache stats after
|
|
||||||
run: ccache --show-stats
|
|
||||||
|
|||||||
@@ -6,13 +6,6 @@ on:
|
|||||||
- main
|
- main
|
||||||
- Development
|
- Development
|
||||||
|
|
||||||
env:
|
|
||||||
CCACHE_DIR: /ccache
|
|
||||||
CCACHE_MAXSIZE: 10G
|
|
||||||
CCACHE_BASEDIR: /root/.conan2
|
|
||||||
CCACHE_NOHASHDIR: "true"
|
|
||||||
CCACHE_COMPILERCHECK: "%compiler% -dumpversion"
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-test:
|
build-and-test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -33,9 +26,11 @@ jobs:
|
|||||||
- name: Generate
|
- name: Generate
|
||||||
run: |
|
run: |
|
||||||
conan profile detect
|
conan profile detect
|
||||||
conan install . --remote=bigfootpackages -pr:h=./ConanProfiles/clang_coverage -pr:b=./ConanProfiles/clang_coverage --build=missing -s build_type=Debug
|
conan install . --remote=bigfootpackages -pr:h=./ConanProfiles/clang_coverage -pr:b=./ConanProfiles/Tools/clang --build=* -s:h build_type=Debug
|
||||||
|
. ./build/Debug/generators/conanbuild.sh
|
||||||
cmake -S . -B ./build/Debug --toolchain ./build/Debug/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Debug -G "Ninja"
|
cmake -S . -B ./build/Debug --toolchain ./build/Debug/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Debug -G "Ninja"
|
||||||
cmake --build build/Debug --parallel $(nproc)
|
cmake --build build/Debug --parallel $(nproc)
|
||||||
|
. ./build/Debug/generators/deactivate_conanbuild.sh
|
||||||
|
|
||||||
- name: Clang-Tidy
|
- name: Clang-Tidy
|
||||||
run: run-clang-tidy -p ./build/Debug/ >> tidy_result.txt
|
run: run-clang-tidy -p ./build/Debug/ >> tidy_result.txt
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ target_link_libraries(${PROJECT_NAME}
|
|||||||
Bin2CPPCompileAndLinkFlags
|
Bin2CPPCompileAndLinkFlags
|
||||||
PUBLIC
|
PUBLIC
|
||||||
quill::quill
|
quill::quill
|
||||||
$<$<CONFIG:Debug,RelWithDebInfo>:cpptrace::cpptrace>
|
|
||||||
magic_enum::magic_enum)
|
magic_enum::magic_enum)
|
||||||
|
|
||||||
target_compile_definitions(${PROJECT_NAME}
|
target_compile_definitions(${PROJECT_NAME}
|
||||||
|
|||||||
@@ -10,8 +10,6 @@
|
|||||||
|
|
||||||
#if defined BIN2CPP_NOT_OPTIMIZED
|
#if defined BIN2CPP_NOT_OPTIMIZED
|
||||||
|
|
||||||
#include <cpptrace/cpptrace.hpp>
|
|
||||||
|
|
||||||
#include <source_location>
|
#include <source_location>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
@@ -35,22 +33,17 @@ class AssertHandler
|
|||||||
* Handle an assertion.
|
* Handle an assertion.
|
||||||
*
|
*
|
||||||
* \param p_location Location of the assertion.
|
* \param p_location Location of the assertion.
|
||||||
* \param p_stacktrace The stack trace
|
|
||||||
* \param p_format Format string for the assertion message.
|
* \param p_format Format string for the assertion message.
|
||||||
* \param p_args Arguments for the format string.
|
* \param p_args Arguments for the format string.
|
||||||
*/
|
*/
|
||||||
template<typename... ARGS>
|
template<typename... ARGS>
|
||||||
static void Handle(const std::source_location& p_location,
|
static void Handle(const std::source_location& p_location, std::format_string<ARGS...> p_format, ARGS&&... p_args)
|
||||||
const std::string_view p_stacktrace,
|
|
||||||
std::format_string<ARGS...> p_format,
|
|
||||||
ARGS&&... p_args)
|
|
||||||
{
|
{
|
||||||
BIN2CPP_LOG_FATAL("Assert: {} (File:{}, Line:{}, Function:{})\n{}",
|
BIN2CPP_LOG_FATAL("Assert: {} (File:{}, Line:{}, Function:{})",
|
||||||
std::format(p_format, std::forward<ARGS>(p_args)...),
|
std::format(p_format, std::forward<ARGS>(p_args)...),
|
||||||
p_location.file_name(),
|
p_location.file_name(),
|
||||||
p_location.line(),
|
p_location.line(),
|
||||||
p_location.function_name(),
|
p_location.function_name());
|
||||||
p_stacktrace);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AssertHandler& operator=(const AssertHandler& p_handler) = delete;
|
AssertHandler& operator=(const AssertHandler& p_handler) = delete;
|
||||||
@@ -78,9 +71,7 @@ class AssertHandler
|
|||||||
constexpr std::source_location location = std::source_location::current(); \
|
constexpr std::source_location location = std::source_location::current(); \
|
||||||
if (!(p_assert)) [[unlikely]] \
|
if (!(p_assert)) [[unlikely]] \
|
||||||
{ \
|
{ \
|
||||||
Bin2CPP::AssertHandler::Handle(location, \
|
Bin2CPP::AssertHandler::Handle(location, p_message __VA_OPT__(, ) __VA_ARGS__); \
|
||||||
cpptrace::generate_trace().to_string(), \
|
|
||||||
p_message __VA_OPT__(, ) __VA_ARGS__); \
|
|
||||||
if (Bin2CPP::Singleton<Bin2CPP::Log>::HasInstance()) \
|
if (Bin2CPP::Singleton<Bin2CPP::Log>::HasInstance()) \
|
||||||
{ \
|
{ \
|
||||||
Bin2CPP::Singleton<Bin2CPP::Log>::Instance().Flush(); \
|
Bin2CPP::Singleton<Bin2CPP::Log>::Instance().Flush(); \
|
||||||
@@ -95,9 +86,7 @@ class AssertHandler
|
|||||||
constexpr std::source_location location = std::source_location::current(); \
|
constexpr std::source_location location = std::source_location::current(); \
|
||||||
if (!(p_assert)) [[unlikely]] \
|
if (!(p_assert)) [[unlikely]] \
|
||||||
{ \
|
{ \
|
||||||
Bin2CPP::AssertHandler::Handle(location, \
|
Bin2CPP::AssertHandler::Handle(location, p_message __VA_OPT__(, ) __VA_ARGS__); \
|
||||||
cpptrace::generate_trace().to_string(), \
|
|
||||||
p_message __VA_OPT__(, ) __VA_ARGS__); \
|
|
||||||
if (Bin2CPP::Singleton<Bin2CPP::Log>::HasInstance()) \
|
if (Bin2CPP::Singleton<Bin2CPP::Log>::HasInstance()) \
|
||||||
{ \
|
{ \
|
||||||
Bin2CPP::Singleton<Bin2CPP::Log>::Instance().Flush(); \
|
Bin2CPP::Singleton<Bin2CPP::Log>::Instance().Flush(); \
|
||||||
@@ -112,9 +101,7 @@ class AssertHandler
|
|||||||
constexpr std::source_location location = std::source_location::current(); \
|
constexpr std::source_location location = std::source_location::current(); \
|
||||||
if (!(p_assert)) [[unlikely]] \
|
if (!(p_assert)) [[unlikely]] \
|
||||||
{ \
|
{ \
|
||||||
Bin2CPP::AssertHandler::Handle(location, \
|
Bin2CPP::AssertHandler::Handle(location, p_message __VA_OPT__(, ) __VA_ARGS__); \
|
||||||
cpptrace::generate_trace().to_string(), \
|
|
||||||
p_message __VA_OPT__(, ) __VA_ARGS__); \
|
|
||||||
if (Bin2CPP::Singleton<Bin2CPP::Log>::HasInstance()) \
|
if (Bin2CPP::Singleton<Bin2CPP::Log>::HasInstance()) \
|
||||||
{ \
|
{ \
|
||||||
Bin2CPP::Singleton<Bin2CPP::Log>::Instance().Flush(); \
|
Bin2CPP::Singleton<Bin2CPP::Log>::Instance().Flush(); \
|
||||||
|
|||||||
@@ -9,8 +9,6 @@ find_package(magic_enum REQUIRED)
|
|||||||
find_package(CLI11 REQUIRED)
|
find_package(CLI11 REQUIRED)
|
||||||
find_package(quill REQUIRED)
|
find_package(quill REQUIRED)
|
||||||
|
|
||||||
find_package(cpptrace REQUIRED)
|
|
||||||
|
|
||||||
if(BUILD_TESTS)
|
if(BUILD_TESTS)
|
||||||
find_package(GTest REQUIRED)
|
find_package(GTest REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
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()
|
|
||||||
9
ConanProfiles/Toolchains/mold.cmake
Normal file
9
ConanProfiles/Toolchains/mold.cmake
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
include_guard()
|
||||||
|
|
||||||
|
find_program(MOLD_PROGRAM mold)
|
||||||
|
if (MOLD_PROGRAM)
|
||||||
|
set(CMAKE_LINKER_TYPE MOLD)
|
||||||
|
message(STATUS "mold linker found: ${MOLD_PROGRAM}")
|
||||||
|
else ()
|
||||||
|
message(WARNING "mold linker not found")
|
||||||
|
endif ()
|
||||||
19
ConanProfiles/Tools/clang
Normal file
19
ConanProfiles/Tools/clang
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
[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=Release
|
||||||
|
|
||||||
|
[conf]
|
||||||
|
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:compiler_executables={"c": "clang", "cpp": "clang++"}
|
||||||
18
ConanProfiles/Tools/msvc
Normal file
18
ConanProfiles/Tools/msvc
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
[settings]
|
||||||
|
os=Windows
|
||||||
|
arch=x86_64
|
||||||
|
compiler=msvc
|
||||||
|
compiler.version=195
|
||||||
|
compiler.cppstd=20
|
||||||
|
compiler.cstd=17
|
||||||
|
compiler.runtime=static
|
||||||
|
build_type=Release
|
||||||
|
|
||||||
|
[conf]
|
||||||
|
tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/../Toolchains/ipo.cmake
|
||||||
|
tools.meson.mesontoolchain:extra_machine_files+={{profile_dir}}/../Toolchains/ipo.ini
|
||||||
|
|
||||||
|
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
|
||||||
@@ -10,22 +10,21 @@ compiler.runtime=static
|
|||||||
build_type=Release
|
build_type=Release
|
||||||
|
|
||||||
[conf]
|
[conf]
|
||||||
tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/Toolchains/ccache.cmake
|
tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/Toolchains/mold.cmake
|
||||||
tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/Toolchains/ipo.cmake
|
tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/Toolchains/ipo.cmake
|
||||||
tools.meson.mesontoolchain:extra_machine_files+={{profile_dir}}/Toolchains/ipo.ini
|
tools.meson.mesontoolchain:extra_machine_files+={{profile_dir}}/Toolchains/ipo.ini
|
||||||
|
|
||||||
tools.system.package_manager:mode=install
|
tools.system.package_manager:mode=install
|
||||||
tools.system.package_manager:sudo=True
|
tools.system.package_manager:sudo=True
|
||||||
|
|
||||||
tools.build:exelinkflags=["-fuse-ld=mold"]
|
|
||||||
tools.build:sharedlinkflags=["-fuse-ld=mold"]
|
|
||||||
|
|
||||||
tools.build:compiler_executables={"c": "clang", "cpp": "clang++"}
|
tools.build:compiler_executables={"c": "clang", "cpp": "clang++"}
|
||||||
|
|
||||||
tools.cmake.cmaketoolchain:generator=Ninja
|
tools.cmake.cmaketoolchain:generator=Ninja
|
||||||
|
|
||||||
[tool_requires]
|
[tool_requires]
|
||||||
!cmake/*: cmake/[>=4.2]
|
!cmake/*: cmake/4.3.2
|
||||||
|
!mold/*: mold/2.41.0@bigfootdev/main
|
||||||
|
!ninja/*: ninja/1.13.2
|
||||||
|
|
||||||
[options]
|
[options]
|
||||||
bin2cpp/*:build_tests=True
|
bin2cpp/*:build_tests=True
|
||||||
|
|||||||
@@ -10,13 +10,13 @@ compiler.runtime=static
|
|||||||
build_type=Debug
|
build_type=Debug
|
||||||
|
|
||||||
[conf]
|
[conf]
|
||||||
tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/Toolchains/ccache.cmake
|
tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/Toolchains/mold.cmake
|
||||||
|
|
||||||
tools.system.package_manager:mode=install
|
tools.system.package_manager:mode=install
|
||||||
tools.system.package_manager:sudo=True
|
tools.system.package_manager:sudo=True
|
||||||
|
|
||||||
tools.build:exelinkflags=["-fuse-ld=mold", "-fsanitize=address,undefined,leak"]
|
tools.build:exelinkflags=["-fsanitize=address,undefined,leak"]
|
||||||
tools.build:sharedlinkflags=["-fuse-ld=mold", "-fsanitize=address,undefined,leak"]
|
tools.build:sharedlinkflags=["-fsanitize=address,undefined,leak"]
|
||||||
|
|
||||||
tools.build:cflags=["-fsanitize=address,undefined,leak", "-fno-sanitize-recover=all"]
|
tools.build:cflags=["-fsanitize=address,undefined,leak", "-fno-sanitize-recover=all"]
|
||||||
tools.build:cxxflags=["-fsanitize=address,undefined,leak", "-fno-sanitize-recover=all"]
|
tools.build:cxxflags=["-fsanitize=address,undefined,leak", "-fno-sanitize-recover=all"]
|
||||||
@@ -26,7 +26,9 @@ tools.cmake.cmaketoolchain:generator=Ninja
|
|||||||
tools.build:compiler_executables={"c": "clang", "cpp": "clang++"}
|
tools.build:compiler_executables={"c": "clang", "cpp": "clang++"}
|
||||||
|
|
||||||
[tool_requires]
|
[tool_requires]
|
||||||
!cmake/*: cmake/[>=4.2]
|
!cmake/*: cmake/4.3.2
|
||||||
|
!mold/*: mold/2.41.0@bigfootdev/main
|
||||||
|
!ninja/*: ninja/1.13.2
|
||||||
|
|
||||||
[options]
|
[options]
|
||||||
bin2cpp/*:asan=True
|
bin2cpp/*:asan=True
|
||||||
|
|||||||
@@ -10,20 +10,19 @@ compiler.runtime=static
|
|||||||
build_type=Debug
|
build_type=Debug
|
||||||
|
|
||||||
[conf]
|
[conf]
|
||||||
tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/Toolchains/ccache.cmake
|
tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/Toolchains/mold.cmake
|
||||||
|
|
||||||
tools.system.package_manager:mode=install
|
tools.system.package_manager:mode=install
|
||||||
tools.system.package_manager:sudo=True
|
tools.system.package_manager:sudo=True
|
||||||
|
|
||||||
tools.build:exelinkflags=["-fuse-ld=mold"]
|
|
||||||
tools.build:sharedlinkflags=["-fuse-ld=mold"]
|
|
||||||
|
|
||||||
tools.cmake.cmaketoolchain:generator=Ninja
|
tools.cmake.cmaketoolchain:generator=Ninja
|
||||||
|
|
||||||
tools.build:compiler_executables={"c": "clang", "cpp": "clang++"}
|
tools.build:compiler_executables={"c": "clang", "cpp": "clang++"}
|
||||||
|
|
||||||
[tool_requires]
|
[tool_requires]
|
||||||
!cmake/*: cmake/[>=4.2]
|
!cmake/*: cmake/4.3.2
|
||||||
|
!mold/*: mold/2.41.0@bigfootdev/main
|
||||||
|
!ninja/*: ninja/1.13.2
|
||||||
|
|
||||||
[options]
|
[options]
|
||||||
bin2cpp/*:build_tests=True
|
bin2cpp/*:build_tests=True
|
||||||
|
|||||||
@@ -9,15 +9,16 @@ compiler.runtime=static
|
|||||||
build_type=Release
|
build_type=Release
|
||||||
|
|
||||||
[conf]
|
[conf]
|
||||||
tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/Toolchains/ccache.cmake
|
|
||||||
tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/Toolchains/ipo.cmake
|
tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/Toolchains/ipo.cmake
|
||||||
tools.meson.mesontoolchain:extra_machine_files+={{profile_dir}}/Toolchains/ipo.ini
|
tools.meson.mesontoolchain:extra_machine_files+={{profile_dir}}/Toolchains/ipo.ini
|
||||||
|
|
||||||
tools.build:cflags=["/Zc:preprocessor", "/Zc:__STDC__", "/D_CRT_DECLARE_NONSTDC_NAMES=1"]
|
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"]
|
tools.build:cxxflags=["/Zc:preprocessor", "/permissive-", "/Zc:__cplusplus", "/Zc:enumTypes", "/Zc:templateScope", "/Zc:throwingNew"]
|
||||||
|
|
||||||
|
tools.env.virtualenv:powershell=powershell.exe
|
||||||
|
|
||||||
[tool_requires]
|
[tool_requires]
|
||||||
!cmake/*: cmake/[>=4.2]
|
!cmake/*: cmake/4.3.2
|
||||||
|
|
||||||
[options]
|
[options]
|
||||||
bin2cpp/*:build_tests=True
|
bin2cpp/*:build_tests=True
|
||||||
|
|||||||
@@ -9,13 +9,13 @@ compiler.runtime=static
|
|||||||
build_type=Debug
|
build_type=Debug
|
||||||
|
|
||||||
[conf]
|
[conf]
|
||||||
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: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"]
|
tools.build:cxxflags=["/Zc:preprocessor", "/permissive-", "/Zc:__cplusplus", "/Zc:enumTypes", "/Zc:templateScope", "/Zc:throwingNew", "/fsanitize=address"]
|
||||||
|
|
||||||
|
tools.env.virtualenv:powershell=powershell.exe
|
||||||
|
|
||||||
[tool_requires]
|
[tool_requires]
|
||||||
!cmake/*: cmake/[>=4.2]
|
!cmake/*: cmake/4.3.2
|
||||||
|
|
||||||
[options]
|
[options]
|
||||||
bin2cpp/*:asan=True
|
bin2cpp/*:asan=True
|
||||||
|
|||||||
@@ -50,8 +50,6 @@ class Bin2CPP(ConanFile):
|
|||||||
self.requires("magic_enum/0.9.7", transitive_headers=True)
|
self.requires("magic_enum/0.9.7", transitive_headers=True)
|
||||||
self.requires("cli11/2.6.1@bigfootdev/main")
|
self.requires("cli11/2.6.1@bigfootdev/main")
|
||||||
|
|
||||||
self.requires("cpptrace/1.0.4", transitive_headers=True)
|
|
||||||
|
|
||||||
if(self.options.build_tests):
|
if(self.options.build_tests):
|
||||||
self.test_requires("gtest/1.17.0")
|
self.test_requires("gtest/1.17.0")
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1,60 @@
|
|||||||
cmake -S . -B build --toolchain build/generators/conan_toolchain.cmake --graphviz=graphviz/graph.dot
|
@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"
|
||||||
|
|
||||||
|
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
|
||||||
@@ -1,3 +1,100 @@
|
|||||||
cmake -S . -B build/Debug --toolchain build/build/Debug/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE="Debug" -G "Ninja" --graphviz=graphviz/Debug/graph.dot
|
#!/usr/bin/env bash
|
||||||
cmake -S . -B build/Release --toolchain build/build/Release/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE="Release" -G "Ninja" --graphviz=graphviz/Release/graph.dot
|
set -euo pipefail
|
||||||
cmake -S . -B build/RelWithDebInfo --toolchain build/build/RelWithDebInfo/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE="RelWithDebInfo" -G "Ninja" --graphviz=graphviz/RelWithDebInfo/graph.dot
|
|
||||||
|
# ─── Validate arguments ───────────────────────────────────────────────────────
|
||||||
|
if [[ $# -lt 1 ]]; then
|
||||||
|
echo "Usage: $(basename "$0") [force|missing] [Release|RelWithDebInfo|Debug]"
|
||||||
|
echo " force - Rebuild all packages from source"
|
||||||
|
echo " missing - Only build packages not already cached"
|
||||||
|
echo " build_type (optional) - One of: Release, RelWithDebInfo, Debug"
|
||||||
|
echo " If omitted, all build types are processed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
case "${1:-}" in
|
||||||
|
force) build_option="--build=*" ;;
|
||||||
|
missing) build_option="--build=missing" ;;
|
||||||
|
*)
|
||||||
|
echo "Usage: $(basename "$0") [force|missing] [Release|RelWithDebInfo|Debug]"
|
||||||
|
echo " force - Rebuild all packages from source"
|
||||||
|
echo " missing - Only build packages not already cached"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# ─── Validate optional build_type argument ────────────────────────────────────
|
||||||
|
all_build_types=(Release RelWithDebInfo Debug)
|
||||||
|
|
||||||
|
if [[ -n "${2:-}" ]]; then
|
||||||
|
case "${2}" in
|
||||||
|
Release|RelWithDebInfo|Debug)
|
||||||
|
build_types=("${2}")
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "ERROR: Invalid build type '${2}'. Must be one of: Release, RelWithDebInfo, Debug"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
else
|
||||||
|
build_types=("${all_build_types[@]}")
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ─── Register remote (skip if already registered) ─────────────────────────────
|
||||||
|
if conan remote list 2>/dev/null | grep -qi "bigfootpackages"; then
|
||||||
|
echo "Conan remote 'bigfootpackages' already registered, skipping."
|
||||||
|
else
|
||||||
|
echo "Adding Conan remote: bigfootpackages"
|
||||||
|
if ! conan remote add bigfootpackages https://conan.romainboullard.com/artifactory/api/conan/BigfootPackages; then
|
||||||
|
echo "ERROR: Failed to add Conan remote."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ─── Shared flags ─────────────────────────────────────────────────────────────
|
||||||
|
conan_common=(
|
||||||
|
--remote=bigfootpackages
|
||||||
|
-pr:h=./ConanProfiles/clang
|
||||||
|
-pr:b=./ConanProfiles/Tools/clang
|
||||||
|
-of build
|
||||||
|
)
|
||||||
|
|
||||||
|
# ─── 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
|
||||||
|
echo "ERROR: conan install failed for build type ${build_type}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "[${build_type}] Done."
|
||||||
|
done
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "All selected build types installed successfully."
|
||||||
|
|
||||||
|
# ─── Configure CMake for each build type ─────────────────────────────────────
|
||||||
|
echo
|
||||||
|
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/build/${build_type}/generators/conanbuild.sh"
|
||||||
|
|
||||||
|
mkdir -p "graphviz/${build_type}"
|
||||||
|
|
||||||
|
echo "[${build_type}] Running CMake..."
|
||||||
|
if ! cmake -S . -B "build/${build_type}" \
|
||||||
|
--toolchain "build/build/${build_type}/generators/conan_toolchain.cmake" \
|
||||||
|
-DCMAKE_BUILD_TYPE="${build_type}" \
|
||||||
|
-G "Ninja" \
|
||||||
|
--graphviz="graphviz/${build_type}/graph.dot"; then
|
||||||
|
echo "ERROR: CMake configuration failed for build type ${build_type}."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "[${build_type}] Done."
|
||||||
|
done
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "CMake configuration successful."
|
||||||
@@ -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/msvc %build_option% -of build -s build_type=Release
|
|
||||||
conan install . --remote=bigfootpackages -pr:h=./ConanProfiles/msvc -pr:b=./ConanProfiles/msvc %build_option% -of build -s build_type=RelWithDebInfo
|
|
||||||
conan install . --remote=bigfootpackages -pr:h=./ConanProfiles/msvc -pr:b=./ConanProfiles/msvc %build_option% -of build -s build_type=Debug
|
|
||||||
|
|
||||||
endlocal
|
|
||||||
@@ -1,25 +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
|
|
||||||
|
|
||||||
# Set the build option based on the argument
|
|
||||||
if [ "$1" == "force" ]; then
|
|
||||||
conan install . --remote=bigfootpackages -pr:h=./ConanProfiles/clang -pr:b=./ConanProfiles/clang --build='*' -of build -s build_type=Release
|
|
||||||
conan install . --remote=bigfootpackages -pr:h=./ConanProfiles/clang -pr:b=./ConanProfiles/clang --build='*' -of build -s build_type=RelWithDebInfo
|
|
||||||
conan install . --remote=bigfootpackages -pr:h=./ConanProfiles/clang -pr:b=./ConanProfiles/clang --build='*' -of build -s build_type=Debug
|
|
||||||
elif [ "$1" == "missing" ]; then
|
|
||||||
conan install . --remote=bigfootpackages -pr:h=./ConanProfiles/clang -pr:b=./ConanProfiles/clang --build=missing -of build -s build_type=Release
|
|
||||||
conan install . --remote=bigfootpackages -pr:h=./ConanProfiles/clang -pr:b=./ConanProfiles/clang --build=missing -of build -s build_type=RelWithDebInfo
|
|
||||||
conan install . --remote=bigfootpackages -pr:h=./ConanProfiles/clang -pr:b=./ConanProfiles/clang --build=missing -of build -s build_type=Debug
|
|
||||||
else
|
|
||||||
echo "Invalid argument: $1"
|
|
||||||
echo "Usage: $0 [force|missing]"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
Reference in New Issue
Block a user