V1 Hotfix #4

Merged
rboullard merged 10 commits from Development into main 2026-03-29 10:45:51 +00:00
13 changed files with 30 additions and 28 deletions

View File

@@ -32,7 +32,7 @@ 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 }} 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
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)

View File

@@ -139,7 +139,7 @@ bool Generator::ComputeMappings()
bool Generator::ComputeFilename() bool Generator::ComputeFilename()
{ {
std::filesystem::path file {m_inputFile.data()}; std::filesystem::path file {m_inputFile.data()};
m_mappingTable[magic_enum::enum_index(MappingKey::FILENAME).value()] = file.filename().string().c_str(); m_mappingTable[magic_enum::enum_index(MappingKey::FILENAME).value()] = file.filename().string();
return true; return true;
} }

View File

@@ -62,18 +62,24 @@ class Log
#define BIN2CPP_LOG_DEBUG(fmt, ...) \ #define BIN2CPP_LOG_DEBUG(fmt, ...) \
do \ do \
{ \ { \
if (quill::Logger* logger = Bin2CPP::Singleton<Bin2CPP::Log>::Instance().GetLogger()) \ if (Bin2CPP::Singleton<Bin2CPP::Log>::HasInstance()) \
{ \ { \
QUILL_LOG_DEBUG(logger, fmt __VA_OPT__(, ) __VA_ARGS__); \ if (quill::Logger* logger = Bin2CPP::Singleton<Bin2CPP::Log>::Instance().GetLogger()) \
{ \
QUILL_LOG_DEBUG(logger, fmt __VA_OPT__(, ) __VA_ARGS__); \
} \
} \ } \
} while (0) } while (0)
#define BIN2CPP_LOG_TRACE(fmt, ...) \ #define BIN2CPP_LOG_TRACE(fmt, ...) \
do \ do \
{ \ { \
if (quill::Logger* logger = Bin2CPP::Singleton<Bin2CPP::Log>::Instance().GetLogger()) \ if (Bin2CPP::Singleton<Bin2CPP::Log>::HasInstance()) \
{ \ { \
QUILL_LOG_TRACE_L3(logger, fmt __VA_OPT__(, ) __VA_ARGS__); \ if (quill::Logger* logger = Bin2CPP::Singleton<Bin2CPP::Log>::Instance().GetLogger()) \
{ \
QUILL_LOG_TRACE_L3(logger, fmt __VA_OPT__(, ) __VA_ARGS__); \
} \
} \ } \
} while (0) } while (0)

View File

@@ -39,6 +39,8 @@ void Log::Flush()
Log::~Log() Log::~Log()
{ {
Flush();
for (quill::Logger* logger: quill::Frontend::get_all_loggers()) for (quill::Logger* logger: quill::Frontend::get_all_loggers())
{ {
quill::Frontend::remove_logger(logger); quill::Frontend::remove_logger(logger);

View File

@@ -39,9 +39,7 @@ TEST_F(GeneratorFixture, GenerateDefault)
namespace namespace
{ {
inline constexpr std::array<std::byte, 11> g_toto_txt = { inline constexpr std::array<std::byte, 11> g_toto_txt = {
std::byte{0x48}, std::byte{0x65}, std::byte{0x6C}, std::byte{0x6C}, std::byte{0x6F}, std::byte{0x48}, std::byte{0x65}, std::byte{0x6C}, std::byte{0x6C}, std::byte{0x6F}, std::byte{0x20}, std::byte{0x57}, std::byte{0x6F}, std::byte{0x72}, std::byte{0x6C}, std::byte{0x64}
std::byte{0x20}, std::byte{0x57}, std::byte{0x6F}, std::byte{0x72}, std::byte{0x6C},
std::byte{0x64}
}; };
} // namespace } // namespace
@@ -73,9 +71,7 @@ TEST_F(GeneratorFixture, GenerateNamespace)
namespace Test namespace Test
{ {
inline constexpr std::array<std::byte, 11> g_toto_txt = { inline constexpr std::array<std::byte, 11> g_toto_txt = {
std::byte{0x48}, std::byte{0x65}, std::byte{0x6C}, std::byte{0x6C}, std::byte{0x6F}, std::byte{0x48}, std::byte{0x65}, std::byte{0x6C}, std::byte{0x6C}, std::byte{0x6F}, std::byte{0x20}, std::byte{0x57}, std::byte{0x6F}, std::byte{0x72}, std::byte{0x6C}, std::byte{0x64}
std::byte{0x20}, std::byte{0x57}, std::byte{0x6F}, std::byte{0x72}, std::byte{0x6C},
std::byte{0x64}
}; };
} // namespace Test } // namespace Test
@@ -109,9 +105,7 @@ TEST_F(GeneratorFixture, GenerateCustomArray)
namespace namespace
{ {
inline constexpr eastl::array<std::byte, 11> g_myArray = { inline constexpr eastl::array<std::byte, 11> g_myArray = {
std::byte{0x48}, std::byte{0x65}, std::byte{0x6C}, std::byte{0x6C}, std::byte{0x6F}, std::byte{0x48}, std::byte{0x65}, std::byte{0x6C}, std::byte{0x6C}, std::byte{0x6F}, std::byte{0x20}, std::byte{0x57}, std::byte{0x6F}, std::byte{0x72}, std::byte{0x6C}, std::byte{0x64}
std::byte{0x20}, std::byte{0x57}, std::byte{0x6F}, std::byte{0x72}, std::byte{0x6C},
std::byte{0x64}
}; };
} // namespace } // namespace

View File

@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.26) cmake_minimum_required(VERSION 3.26)
project(Bin2CPP VERSION 0.1.0 project(Bin2CPP VERSION 1.0.0
DESCRIPTION "Bin2CPP" DESCRIPTION "Bin2CPP"
LANGUAGES CXX) LANGUAGES CXX)

View File

@@ -29,4 +29,4 @@ tools.cmake.cmaketoolchain:generator=Ninja
!cmake/*: cmake/[>=4.2] !cmake/*: cmake/[>=4.2]
[options] [options]
Bin2CPP/*:build_tests=True bin2cpp/*:build_tests=True

View File

@@ -26,5 +26,5 @@ tools.build:compiler_executables={"c": "clang", "cpp": "clang++"}
!cmake/*: cmake/[>=4.2] !cmake/*: cmake/[>=4.2]
[options] [options]
Bin2CPP/*:build_tests=True bin2cpp/*:build_tests=True
Bin2CPP/*:coverage=True bin2cpp/*:coverage=True

View File

@@ -26,4 +26,4 @@ tools.build:compiler_executables={"c": "clang", "cpp": "clang++"}
!cmake/*: cmake/[>=4.2] !cmake/*: cmake/[>=4.2]
[options] [options]
Bin2CPP/*:build_tests=True bin2cpp/*:build_tests=True

View File

@@ -29,5 +29,5 @@ tools.build:compiler_executables={"c": "clang", "cpp": "clang++"}
!cmake/*: cmake/[>=4.2] !cmake/*: cmake/[>=4.2]
[options] [options]
Bin2CPP/*:asan=True bin2cpp/*:asan=True
Bin2CPP/*:build_tests=True bin2cpp/*:build_tests=True

View File

@@ -21,4 +21,4 @@ tools.build:cxxflags=["/Zc:preprocessor", "/permissive-", "/Zc:__cplusplus", "/Z
!cmake/*: cmake/[>=4.2] !cmake/*: cmake/[>=4.2]
[options] [options]
Bin2CPP/*:build_tests=True bin2cpp/*:build_tests=True

View File

@@ -17,4 +17,4 @@ tools.build:cxxflags=["/Zc:preprocessor", "/permissive-", "/Zc:__cplusplus", "/Z
!cmake/*: cmake/[>=4.2] !cmake/*: cmake/[>=4.2]
[options] [options]
Bin2CPP/*:build_tests=True bin2cpp/*:build_tests=True

View File

@@ -14,12 +14,12 @@ tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/msvc_ccache.cmake
tools.build:exelinkflags=["/INCREMENTAL:NO"] tools.build:exelinkflags=["/INCREMENTAL:NO"]
tools.build:sharedlinkflags=["/INCREMENTAL:NO"] tools.build:sharedlinkflags=["/INCREMENTAL:NO"]
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", "/fsanitize=address"]
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", "/fsanitize=address"]
[tool_requires] [tool_requires]
!cmake/*: cmake/[>=4.2] !cmake/*: cmake/[>=4.2]
[options] [options]
Bin2CPP/*:asan=True bin2cpp/*:asan=True
Bin2CPP/*:build_tests=True bin2cpp/*:build_tests=True