From 53a053de279b3f91699fcd5b0cc95d952d3f01b8 Mon Sep 17 00:00:00 2001 From: Romain BOULLARD Date: Wed, 28 Jan 2026 16:50:26 +0000 Subject: [PATCH] GiteaCI (#3) Reviewed-on: https://git.romainboullard.com/BigfootDev/Bigfoot/pulls/3 Co-authored-by: Romain BOULLARD Co-committed-by: Romain BOULLARD --- .devcontainer/devcontainer.json | 4 + .gitea/workflows/ci.yml | 65 +++++++ .gitlab-ci.yml | 79 -------- Bigfoot/Sources/CMakeLists.txt | 2 +- .../Sources/Engine/BigFile/BigFileSchema.sql | 46 ++++- Bigfoot/Sources/Engine/BigFile/Database.cpp | 12 -- Bigfoot/Sources/Engine/CMakeLists.txt | 7 +- ...ed.hpp.in => BigFileInfo_generated.hpp.in} | 12 +- .../Include/Engine/BigFile/Database.hpp | 19 -- .../Include/Engine/BigFile/Statement.hpp | 0 .../Include/Engine/EngineAssertHandler.hpp | 60 ++++++ ...generated.hpp => EngineInfo_generated.hpp} | 12 +- ...ted.hpp.in => EngineInfo_generated.hpp.in} | 12 +- ...nerated.hpp => EngineLogger_generated.hpp} | 8 +- Bigfoot/Sources/Engine/touch.cpp | 1 + Bigfoot/Sources/System/CMakeLists.txt | 22 ++- Bigfoot/Sources/System/File.cpp | 66 +++++++ .../Sources/System/Include/System/File.hpp | 103 ++++++++++ .../Include/System/Log/EASTLFormatters.hpp | 95 ++++++++++ .../Sources/System/Include/System/Log/Log.fbs | 16 ++ .../Include/System/Log}/Log.hpp | 39 ++-- .../Include/System/Log/Log_generated.hpp | 136 +++++++++++++ .../System/Log/TargetLogger_generated.hpp.in} | 8 +- .../Include/System/SystemAssertHandler.hpp | 60 ++++++ .../System/SystemLogger_generated.hpp} | 14 +- .../Sources/System/Include/System/Time.hpp | 68 +++++++ .../System/Include/System/UUID/FlatUUID.hpp | 18 ++ .../System/Include/System/UUID/UUID.fbs | 8 + .../System/Include/System/{ => UUID}/UUID.hpp | 44 ++++- .../Include/System/UUID/UUID_generated.hpp | 74 ++++++++ Bigfoot/Sources/{Utils => System/Log}/Log.cpp | 28 +-- Bigfoot/Sources/System/Time.cpp | 121 ++++++++++++ Bigfoot/Sources/System/UUID/FlatUUID.cpp | 27 +++ Bigfoot/Sources/System/{ => UUID}/UUID.cpp | 2 +- Bigfoot/Sources/Utils/CMakeLists.txt | 12 +- .../Sources/Utils/Include/Utils/Assert.hpp | 1 - .../Sources/Utils/Include/Utils/Caster.hpp | 37 ++-- .../Sources/Utils/Include/Utils/Singleton.hpp | 22 ++- .../Utils/Include/Utils/TaggedType.hpp | 131 +++++++++++++ .../Include/Utils/UtilsAssertHandler.hpp | 49 ----- .../Sources/Utils/Include/Utils/Version.hpp | 6 +- Bigfoot/Tests/Engine/BigFile/Database.cpp | 1 - Bigfoot/Tests/Engine/BigFile/Statement.cpp | 0 Bigfoot/Tests/Engine/CMakeLists.txt | 14 +- .../Include/Bigfoot/BigFileInfo_generated.hpp | 19 -- .../EngineTests/BigFileInfo.generated.hpp | 19 -- Bigfoot/Tests/Engine/touch.cpp | 1 + Bigfoot/Tests/System/CMakeLists.txt | 13 +- Bigfoot/Tests/System/File.cpp | 80 ++++++++ .../System/Fixture/file} | 0 .../SystemTestsLogger_generated.hpp | 21 ++ Bigfoot/Tests/{Utils => System/Log}/Log.cpp | 64 ++++--- Bigfoot/Tests/System/Time.cpp | 67 +++++++ Bigfoot/Tests/System/{ => UUID}/UUID.cpp | 2 +- Bigfoot/Tests/Utils/CMakeLists.txt | 12 +- Bigfoot/Tests/Utils/Caster.cpp | 19 -- Bigfoot/Tests/Utils/UtilsAssertHandler.cpp | 0 CI/templates.yml | 121 ------------ CMake/FindDependencies.cmake | 8 +- CMake/Package.cmake | 64 ++++--- CMake/Utils.cmake | 179 +++++++++--------- CMakeLists.txt | 21 +- README.md | 18 -- Vendor/Tools/Mimalloc2.2.4/minject.exe | Bin 24064 -> 0 bytes conanfile.py | 52 ++--- format.bat | 87 ++++++--- format.sh | 87 ++++++--- generate_dependencies.bat | 8 +- generate_dependencies.sh | 14 +- sonar-project.properties | 10 - sonarqube.sh | 15 -- 71 files changed, 1774 insertions(+), 788 deletions(-) create mode 100644 .devcontainer/devcontainer.json create mode 100644 .gitea/workflows/ci.yml delete mode 100644 .gitlab-ci.yml delete mode 100644 Bigfoot/Sources/Engine/BigFile/Database.cpp rename Bigfoot/Sources/Engine/Include/Engine/BigFile/{BigFileInfo.generated.hpp.in => BigFileInfo_generated.hpp.in} (50%) delete mode 100644 Bigfoot/Sources/Engine/Include/Engine/BigFile/Database.hpp delete mode 100644 Bigfoot/Sources/Engine/Include/Engine/BigFile/Statement.hpp create mode 100644 Bigfoot/Sources/Engine/Include/Engine/EngineAssertHandler.hpp rename Bigfoot/Sources/Engine/Include/Engine/{EngineInfo.generated.hpp => EngineInfo_generated.hpp} (65%) rename Bigfoot/Sources/Engine/Include/Engine/{EngineInfo.generated.hpp.in => EngineInfo_generated.hpp.in} (60%) rename Bigfoot/Sources/Engine/Include/Engine/{EngineLogger.generated.hpp => EngineLogger_generated.hpp} (73%) create mode 100644 Bigfoot/Sources/Engine/touch.cpp create mode 100644 Bigfoot/Sources/System/File.cpp create mode 100644 Bigfoot/Sources/System/Include/System/File.hpp create mode 100644 Bigfoot/Sources/System/Include/System/Log/EASTLFormatters.hpp create mode 100644 Bigfoot/Sources/System/Include/System/Log/Log.fbs rename Bigfoot/Sources/{Utils/Include/Utils => System/Include/System/Log}/Log.hpp (94%) create mode 100644 Bigfoot/Sources/System/Include/System/Log/Log_generated.hpp rename Bigfoot/Sources/{Utils/Include/Utils/TargetLogger.generated.hpp.in => System/Include/System/Log/TargetLogger_generated.hpp.in} (74%) create mode 100644 Bigfoot/Sources/System/Include/System/SystemAssertHandler.hpp rename Bigfoot/{Tests/Utils/Include/UtilsTests/UtilsTestsLogger.generated.hpp => Sources/System/Include/System/SystemLogger_generated.hpp} (50%) create mode 100644 Bigfoot/Sources/System/Include/System/Time.hpp create mode 100644 Bigfoot/Sources/System/Include/System/UUID/FlatUUID.hpp create mode 100644 Bigfoot/Sources/System/Include/System/UUID/UUID.fbs rename Bigfoot/Sources/System/Include/System/{ => UUID}/UUID.hpp (69%) create mode 100644 Bigfoot/Sources/System/Include/System/UUID/UUID_generated.hpp rename Bigfoot/Sources/{Utils => System/Log}/Log.cpp (71%) create mode 100644 Bigfoot/Sources/System/Time.cpp create mode 100644 Bigfoot/Sources/System/UUID/FlatUUID.cpp rename Bigfoot/Sources/System/{ => UUID}/UUID.cpp (98%) create mode 100644 Bigfoot/Sources/Utils/Include/Utils/TaggedType.hpp delete mode 100644 Bigfoot/Sources/Utils/Include/Utils/UtilsAssertHandler.hpp delete mode 100644 Bigfoot/Tests/Engine/BigFile/Database.cpp delete mode 100644 Bigfoot/Tests/Engine/BigFile/Statement.cpp delete mode 100644 Bigfoot/Tests/Engine/Include/Bigfoot/BigFileInfo_generated.hpp delete mode 100644 Bigfoot/Tests/Engine/Include/EngineTests/BigFileInfo.generated.hpp create mode 100644 Bigfoot/Tests/Engine/touch.cpp create mode 100644 Bigfoot/Tests/System/File.cpp rename Bigfoot/{Sources/Engine/BigFile/Statement.cpp => Tests/System/Fixture/file} (100%) create mode 100644 Bigfoot/Tests/System/Include/SystemTests/SystemTestsLogger_generated.hpp rename Bigfoot/Tests/{Utils => System/Log}/Log.cpp (56%) create mode 100644 Bigfoot/Tests/System/Time.cpp rename Bigfoot/Tests/System/{ => UUID}/UUID.cpp (99%) delete mode 100644 Bigfoot/Tests/Utils/UtilsAssertHandler.cpp delete mode 100644 CI/templates.yml delete mode 100644 Vendor/Tools/Mimalloc2.2.4/minject.exe delete mode 100644 sonar-project.properties delete mode 100644 sonarqube.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..46a94d4 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,4 @@ +{ + "name": "Bigfoot", + "image": "git.romainboullard.com/bigfootdev/linuxbigfootbuilder:main" +} diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..8c52204 --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,65 @@ +name: Bigfoot + +on: + push: + branches: + - '**' + workflow_dispatch: + +env: + CCACHE_BASEDIR: ${{ github.workspace }} + +jobs: + build-and-test: + runs-on: ubuntu-latest + timeout-minutes: 120 + container: + image: git.romainboullard.com/bigfootdev/linuxbigfootbuilder:main + strategy: + matrix: + build_type: ["Debug", "RelWithDebInfo", "Release"] + unity_build: ["ON", "OFF"] + name: "Build & Test ${{ matrix.build_type }} (Unity Build: ${{ matrix.unity_build }})" + steps: + - name: Install Node.js + run: apt-get update && apt-get install -y nodejs + + - name: Checkout repository + uses: actions/checkout@v6 + with: + submodules: recursive + + - name: Show ccache stats before + run: ccache --zero-stats + + - 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 + 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) + + - name: Show ccache stats after + run: ccache --show-stats + + - name: Unit Tests + run: | + cd ./build/${{ matrix.build_type }} + xvfb-run ctest . --output-on-failure + + clang-format: + runs-on: ubuntu-latest + timeout-minutes: 120 + container: + image: git.romainboullard.com/bigfootdev/linuxbigfootbuilder:main + name: "Clang Format Checks" + steps: + - name: Install Node.js + run: apt-get update && apt-get install -y nodejs + + - name: Checkout repository + uses: actions/checkout@v6 + with: + submodules: recursive + + - name: Clang Format Checks + run: chmod +x format.sh && ./format.sh --check Bigfoot \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 1a1570a..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,79 +0,0 @@ -include: '/CI/templates.yml' - -variables: - SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" - GIT_SUBMODULE_STRATEGY: recursive - GIT_DEPTH: "0" - -stages: - - build - - build-unity - - unit-tests - - sonar - -# ******************************************DEBUG****************************************** - -BuildDebug: - extends: .Build - variables: - BUILD_TYPE: 'Debug' - -BuildUnityDebug: - extends: .BuildUnity - variables: - BUILD_TYPE: 'Debug' - -UnitTestsDebug: - extends: .UnitTests - variables: - BUILD_TYPE: 'Debug' - needs: - - BuildUnityDebug - -# ******************************************RELWITHDEBINFO****************************************** - -BuildRelWithDebInfo: - extends: .Build - variables: - BUILD_TYPE: 'RelWithDebInfo' - -BuildUnityRelWithDebInfo: - extends: .BuildUnity - variables: - BUILD_TYPE: 'RelWithDebInfo' - -UnitTestsRelWithDebInfo: - extends: .UnitTests - variables: - BUILD_TYPE: 'RelWithDebInfo' - needs: - - BuildUnityRelWithDebInfo - -# ******************************************RELEASE****************************************** - -BuildRelease: - extends: .Build - variables: - BUILD_TYPE: 'Release' - -BuildUnityRelease: - extends: .BuildUnity - variables: - BUILD_TYPE: 'Release' - -UnitTestsRelease: - extends: .UnitTests - variables: - BUILD_TYPE: 'Release' - needs: - - BuildUnityRelease - -# ******************************************Sonar****************************************** - -SonarCloud: - extends: .SonarCloud - dependencies: [] - only: - - merge_requests - - main - - Development diff --git a/Bigfoot/Sources/CMakeLists.txt b/Bigfoot/Sources/CMakeLists.txt index bdd68d7..8eca193 100644 --- a/Bigfoot/Sources/CMakeLists.txt +++ b/Bigfoot/Sources/CMakeLists.txt @@ -1,3 +1,3 @@ -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/System) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/Utils) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/System) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/Engine) \ No newline at end of file diff --git a/Bigfoot/Sources/Engine/BigFile/BigFileSchema.sql b/Bigfoot/Sources/Engine/BigFile/BigFileSchema.sql index 2104d4e..e307f48 100644 --- a/Bigfoot/Sources/Engine/BigFile/BigFileSchema.sql +++ b/Bigfoot/Sources/Engine/BigFile/BigFileSchema.sql @@ -1,11 +1,41 @@ PRAGMA journal_mode=WAL; +PRAGMA foreign_keys = ON; + +DROP TABLE IF EXISTS AssetHeader; +CREATE TABLE IF NOT EXISTS AssetHeader ( + UUID BLOB NOT NULL UNIQUE, + Name TEXT NOT NULL UNIQUE, + TypeID INTEGER NOT NULL, + TypeName TEXT NOT NULL, + + CreateTime INTEGER NOT NULL DEFAULT(CAST(unixepoch('subsec') AS INTEGER) * 1000000), + ModificationTime INTEGER NOT NULL DEFAULT(CAST(unixepoch('subsec') AS INTEGER) * 1000000), -DROP TABLE IF EXISTS FsEntry; -CREATE TABLE IF NOT EXISTS FsEntry ( - UUID BLOB NOT NULL UNIQUE, - Name TEXT NOT NULL UNIQUE, - CreateTime INTEGER NOT NULL, - ModificationTime INTEGER NOT NULL, - Asset BLOB, PRIMARY KEY(UUID) -); \ No newline at end of file +); + +CREATE TRIGGER IF NOT EXISTS AssetHeader_UpdateTime +AFTER UPDATE OF Name, TypeID, TypeName ON AssetHeader FOR EACH ROW +BEGIN + UPDATE AssetHeader + SET ModificationTime = CAST(unixepoch('subsec') AS INTEGER) * 1000000 + WHERE UUID = NEW.UUID; +END; + +DROP TABLE IF EXISTS Asset; +CREATE TABLE IF NOT EXISTS Asset ( + UUID BLOB NOT NULL UNIQUE, + + Asset BLOB NOT NULL, + + PRIMARY KEY(UUID), + FOREIGN KEY(UUID) REFERENCES AssetHeader(UUID) ON DELETE CASCADE +); + +CREATE TRIGGER IF NOT EXISTS Asset_UpdateTime +AFTER UPDATE OF Asset ON Asset FOR EACH ROW +BEGIN + UPDATE AssetHeader + SET ModificationTime = CAST(unixepoch('subsec') AS INTEGER) * 1000000 + WHERE UUID = NEW.UUID; +END; \ No newline at end of file diff --git a/Bigfoot/Sources/Engine/BigFile/Database.cpp b/Bigfoot/Sources/Engine/BigFile/Database.cpp deleted file mode 100644 index 350f8c0..0000000 --- a/Bigfoot/Sources/Engine/BigFile/Database.cpp +++ /dev/null @@ -1,12 +0,0 @@ -/********************************************************************* - * \file Database.cpp - * - * \author Romain BOULLARD - * \date October 2025 - *********************************************************************/ -#include - -namespace Bigfoot -{ - -} // namespace Bigfoot diff --git a/Bigfoot/Sources/Engine/CMakeLists.txt b/Bigfoot/Sources/Engine/CMakeLists.txt index e794157..943596b 100644 --- a/Bigfoot/Sources/Engine/CMakeLists.txt +++ b/Bigfoot/Sources/Engine/CMakeLists.txt @@ -1,9 +1,11 @@ get_filename_component(PackageName ${CMAKE_CURRENT_SOURCE_DIR} NAME) +project(${PackageName}) set(PublicDependencies SQLite::SQLite3) set(PrivateDependencies) set(BigfootPublicDependencies + System Utils) set(BigfootPrivateDependencies) @@ -11,12 +13,11 @@ set(BIGFOOT_MAJOR 0) set(BIGFOOT_MINOR 1) set(BIGFOOT_PATCH 0) set(BIGFOOT_NAME "Bigfoot") -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Include/Engine/EngineInfo.generated.hpp.in ${CMAKE_CURRENT_SOURCE_DIR}/Include/Engine/EngineInfo.generated.hpp @ONLY) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Include/Engine/EngineInfo_generated.hpp.in ${CMAKE_CURRENT_SOURCE_DIR}/Include/Engine/EngineInfo_generated.hpp @ONLY) -bigfoot_create_logger(${PackageName}) +bigfoot_create_logger() bigfoot_create_package_lib( - ${PackageName} "${PublicDependencies}" "${PrivateDependencies}" "${BigfootPublicDependencies}" diff --git a/Bigfoot/Sources/Engine/Include/Engine/BigFile/BigFileInfo.generated.hpp.in b/Bigfoot/Sources/Engine/Include/Engine/BigFile/BigFileInfo_generated.hpp.in similarity index 50% rename from Bigfoot/Sources/Engine/Include/Engine/BigFile/BigFileInfo.generated.hpp.in rename to Bigfoot/Sources/Engine/Include/Engine/BigFile/BigFileInfo_generated.hpp.in index f332599..66f4d7e 100644 --- a/Bigfoot/Sources/Engine/Include/Engine/BigFile/BigFileInfo.generated.hpp.in +++ b/Bigfoot/Sources/Engine/Include/Engine/BigFile/BigFileInfo_generated.hpp.in @@ -2,18 +2,18 @@ /********************************************************************* * \file BigFileInfo.generated.hpp - * + * *********************************************************************/ -#ifndef BIGFOOT_ENGINE_BIGFILE_BIGFILEINFO_GENERATED_HPP -#define BIGFOOT_ENGINE_BIGFILE_BIGFILEINFO_GENERATED_HPP +#ifndef BIGFOOT_@BIGFILE_NAME@_BIGFILEINFO_GENERATED_HPP +#define BIGFOOT_@BIGFILE_NAME@_BIGFILEINFO_GENERATED_HPP -#include +#include namespace Bigfoot { /* * BigFile location */ -constexpr std::string_view BIGFILE_@BIGFILE_NAME@_LOCATION{"@BIGFILE_LOCATION@"}; -} +constexpr eastl::string_view BIGFILE_@BIGFILE_NAME@_LOCATION {"@BIGFILE_LOCATION@"}; +} // namespace Bigfoot #endif \ No newline at end of file diff --git a/Bigfoot/Sources/Engine/Include/Engine/BigFile/Database.hpp b/Bigfoot/Sources/Engine/Include/Engine/BigFile/Database.hpp deleted file mode 100644 index 2e6ff10..0000000 --- a/Bigfoot/Sources/Engine/Include/Engine/BigFile/Database.hpp +++ /dev/null @@ -1,19 +0,0 @@ -/********************************************************************* - * \file Database.hpp - * - * \author Romain BOULLARD - * \date October 2025 - *********************************************************************/ -#ifndef BIGFOOT_ENGINE_BIGFILE_DATABASE_HPP -#define BIGFOOT_ENGINE_BIGFILE_DATABASE_HPP - -#include - -#include - -namespace Bigfoot -{ - -} // namespace Bigfoot - -#endif diff --git a/Bigfoot/Sources/Engine/Include/Engine/BigFile/Statement.hpp b/Bigfoot/Sources/Engine/Include/Engine/BigFile/Statement.hpp deleted file mode 100644 index e69de29..0000000 diff --git a/Bigfoot/Sources/Engine/Include/Engine/EngineAssertHandler.hpp b/Bigfoot/Sources/Engine/Include/Engine/EngineAssertHandler.hpp new file mode 100644 index 0000000..1c969a7 --- /dev/null +++ b/Bigfoot/Sources/Engine/Include/Engine/EngineAssertHandler.hpp @@ -0,0 +1,60 @@ +/********************************************************************* + * \file EngineAssertHandler.hpp + * + * \author Romain BOULLARD + * \date December 2025 + *********************************************************************/ +#ifndef BIGFOOT_ENGINE_ENGINEASSERTHANDLER_HPP +#define BIGFOOT_ENGINE_ENGINEASSERTHANDLER_HPP +#include + +#include + +#if defined BIGFOOT_NOT_OPTIMIZED +#include + +#include +#include +#include + +namespace Bigfoot +{ +class EngineAssertHandler +{ + public: + EngineAssertHandler() = delete; + + EngineAssertHandler(const EngineAssertHandler& p_handler) = delete; + EngineAssertHandler(EngineAssertHandler&& p_handler) = delete; + + ~EngineAssertHandler() = delete; + + /** + * Handle an 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_args Arguments for the format string. + */ + template + static void Handle(const std::source_location& p_location, + const std::string_view p_stacktrace, + std::format_string p_format, + ARGS&&... p_args) + { + BIGFOOT_LOG_FATAL(ENGINE_LOGGER, + "Assert: {} (File:{}, Line:{}, Function:{}\n{}", + std::format(p_format, eastl::forward(p_args)...), + p_location.file_name(), + p_location.line(), + p_location.function_name(), + p_stacktrace); + } + + EngineAssertHandler& operator=(const EngineAssertHandler& p_handler) = delete; + EngineAssertHandler& operator=(EngineAssertHandler&& p_handler) = delete; +}; +} // namespace Bigfoot +#endif +#endif diff --git a/Bigfoot/Sources/Engine/Include/Engine/EngineInfo.generated.hpp b/Bigfoot/Sources/Engine/Include/Engine/EngineInfo_generated.hpp similarity index 65% rename from Bigfoot/Sources/Engine/Include/Engine/EngineInfo.generated.hpp rename to Bigfoot/Sources/Engine/Include/Engine/EngineInfo_generated.hpp index 025cb45..9c95d8f 100644 --- a/Bigfoot/Sources/Engine/Include/Engine/EngineInfo.generated.hpp +++ b/Bigfoot/Sources/Engine/Include/Engine/EngineInfo_generated.hpp @@ -1,23 +1,25 @@ // AUTO-GENERATED DO NOT TOUCH /********************************************************************* - * \file EngineInfo.generated.hpp - * + * \file EngineInfo_generated.hpp + * *********************************************************************/ #ifndef BIGFOOT_ENGINE_ENGINEINFO_GENERATED_HPP #define BIGFOOT_ENGINE_ENGINEINFO_GENERATED_HPP #include +#include + namespace Bigfoot { /* * Engine version */ -constexpr Version BIGFOOT_VERSION{0, 1, 0}; +constexpr Version BIGFOOT_VERSION {0, 1, 0}; /* * Engine name */ -constexpr std::string_view BIGFOOT_NAME{"Bigfoot"}; -} +constexpr eastl::string_view BIGFOOT_NAME {"Bigfoot"}; +} // namespace Bigfoot #endif diff --git a/Bigfoot/Sources/Engine/Include/Engine/EngineInfo.generated.hpp.in b/Bigfoot/Sources/Engine/Include/Engine/EngineInfo_generated.hpp.in similarity index 60% rename from Bigfoot/Sources/Engine/Include/Engine/EngineInfo.generated.hpp.in rename to Bigfoot/Sources/Engine/Include/Engine/EngineInfo_generated.hpp.in index fd5948d..17110bc 100644 --- a/Bigfoot/Sources/Engine/Include/Engine/EngineInfo.generated.hpp.in +++ b/Bigfoot/Sources/Engine/Include/Engine/EngineInfo_generated.hpp.in @@ -1,23 +1,25 @@ @AUTO_GENERATED_COMMENT@ /********************************************************************* - * \file EngineInfo.generated.hpp - * + * \file EngineInfo_generated.hpp + * *********************************************************************/ #ifndef BIGFOOT_ENGINE_ENGINEINFO_GENERATED_HPP #define BIGFOOT_ENGINE_ENGINEINFO_GENERATED_HPP #include +#include + namespace Bigfoot { /* * Engine version */ -constexpr Version BIGFOOT_VERSION{@BIGFOOT_MAJOR@, @BIGFOOT_MINOR@, @BIGFOOT_PATCH@}; +constexpr Version BIGFOOT_VERSION {@BIGFOOT_MAJOR@, @BIGFOOT_MINOR@, @BIGFOOT_PATCH@}; /* * Engine name */ -constexpr std::string_view BIGFOOT_NAME{"@BIGFOOT_NAME@"}; -} +constexpr eastl::string_view BIGFOOT_NAME {"@BIGFOOT_NAME@"}; +} // namespace Bigfoot #endif \ No newline at end of file diff --git a/Bigfoot/Sources/Engine/Include/Engine/EngineLogger.generated.hpp b/Bigfoot/Sources/Engine/Include/Engine/EngineLogger_generated.hpp similarity index 73% rename from Bigfoot/Sources/Engine/Include/Engine/EngineLogger.generated.hpp rename to Bigfoot/Sources/Engine/Include/Engine/EngineLogger_generated.hpp index 437596f..e3e58e9 100644 --- a/Bigfoot/Sources/Engine/Include/Engine/EngineLogger.generated.hpp +++ b/Bigfoot/Sources/Engine/Include/Engine/EngineLogger_generated.hpp @@ -2,11 +2,11 @@ /********************************************************************* * \file EngineLogger.generated.hpp - * + * *********************************************************************/ #ifndef BIGFOOT_ENGINELOGGER_GENERATED_HPP #define BIGFOOT_ENGINELOGGER_GENERATED_HPP -#include +#include #if defined BIGFOOT_NOT_OPTIMIZED @@ -15,7 +15,7 @@ namespace Bigfoot /* * Logger */ -inline Log::LoggerInfo ENGINE_LOGGER {"ENGINE_LOGGER", Log::LogLevel::Trace}; -} +inline Log::LoggerInfo ENGINE_LOGGER {"ENGINE_LOGGER", Flat::LogLevel::Trace}; +} // namespace Bigfoot #endif #endif diff --git a/Bigfoot/Sources/Engine/touch.cpp b/Bigfoot/Sources/Engine/touch.cpp new file mode 100644 index 0000000..cc4afd9 --- /dev/null +++ b/Bigfoot/Sources/Engine/touch.cpp @@ -0,0 +1 @@ +// to delete when an actual source is in Engine diff --git a/Bigfoot/Sources/System/CMakeLists.txt b/Bigfoot/Sources/System/CMakeLists.txt index 011e862..e25e7e0 100644 --- a/Bigfoot/Sources/System/CMakeLists.txt +++ b/Bigfoot/Sources/System/CMakeLists.txt @@ -1,26 +1,28 @@ get_filename_component(PackageName ${CMAKE_CURRENT_SOURCE_DIR} NAME) +project(${PackageName}) set(PublicDependencies + $<$:quill::quill> mimalloc - magic_enum::magic_enum - unordered_dense::unordered_dense - EASTL::EASTL - stduuid::stduuid - $<$:Tracy::TracyClient>) + stduuid::stduuid) set(PrivateDependencies) -set(BigfootPublicDependencies) +set(BigfootPublicDependencies + Utils) set(BigfootPrivateDependencies) bigfoot_create_package_lib( - ${PackageName} "${PublicDependencies}" "${PrivateLibraries}" "${BigfootPublicDependencies}" "${BigfootPrivateDependencies}" "") -target_compile_definitions(${PackageName} - PUBLIC MI_SHARED_LIB - PUBLIC $<$:TRACY>) +bigfoot_create_logger() + +target_compile_definitions(${PROJECT_NAME} + PUBLIC $<$:QUILL_NO_EXCEPTIONS> + PUBLIC $<$:QUILL_DISABLE_NON_PREFIXED_MACROS> + + PUBLIC MI_SHARED_LIB) set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/MimallocImpl.cpp PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) diff --git a/Bigfoot/Sources/System/File.cpp b/Bigfoot/Sources/System/File.cpp new file mode 100644 index 0000000..ff57db3 --- /dev/null +++ b/Bigfoot/Sources/System/File.cpp @@ -0,0 +1,66 @@ +/********************************************************************* + * \file File.cpp + * + * \author Romain BOULLARD + * \date December 2025 + *********************************************************************/ +#include + +namespace Bigfoot +{ +File::File(const eastl::string_view p_path): + m_path(p_path.data()), + m_pathString(p_path) +{ +} + +/****************************************************************************************/ + +bool File::IsAbsolute() const +{ + return m_path.is_absolute(); +} + +/****************************************************************************************/ + +bool File::IsRelative() const +{ + return m_path.is_relative(); +} + +/****************************************************************************************/ + +bool File::Exists() const +{ + return std::filesystem::exists(m_path); +} + +/****************************************************************************************/ + +eastl::string_view File::Path() const +{ + return m_pathString; +} + +/****************************************************************************************/ + +File File::Absolute() const +{ + return File {std::filesystem::absolute(m_path)}; +} + +/****************************************************************************************/ + +File File::Relative() const +{ + return File {std::filesystem::relative(m_path)}; +} + +/****************************************************************************************/ + +File::File(const std::filesystem::path& p_path): + m_path(p_path), + m_pathString(m_path.string().c_str()) +{ +} +} // namespace Bigfoot diff --git a/Bigfoot/Sources/System/Include/System/File.hpp b/Bigfoot/Sources/System/Include/System/File.hpp new file mode 100644 index 0000000..0c67f62 --- /dev/null +++ b/Bigfoot/Sources/System/Include/System/File.hpp @@ -0,0 +1,103 @@ +/********************************************************************* + * \file File.hpp + * + * \author Romain BOULLARD + * \date December 2025 + *********************************************************************/ +#ifndef BIGFOOT_SYSTEM_FILE_HPP +#define BIGFOOT_SYSTEM_FILE_HPP + +#include +#include + +#include + +namespace Bigfoot +{ +class File +{ + public: + /** + * Constructor + * + * \param p_path The path + */ + File(const eastl::string_view p_path); + + File(const File& p_path) = default; + File(File&& p_path) = default; + + /** + * Check if the file is relative to the current executable + * + * \return True if the file is relative, false otherwise + */ + [[nodiscard]] + bool IsRelative() const; + + /** + * Check if the file is absolute + * + * \return True if the file is absolute, false otherwise + */ + [[nodiscard]] + bool IsAbsolute() const; + + /** + * Check if the file exists + * + * \return True if it exists, false otherwise + */ + [[nodiscard]] + bool Exists() const; + + /** + * Get the file path + * + * \return The path + */ + [[nodiscard]] + eastl::string_view Path() const; + + /** + * Get the same file, relative to the current executable + * + * \return The relative file + */ + [[nodiscard]] + File Relative() const; + + /** + * Get the same file, with an absolute path + * + * \return The absolute file + */ + [[nodiscard]] + File Absolute() const; + + ~File() = default; + + File& operator=(const File& p_path) = default; + File& operator=(File&& p_path) = default; + + private: + /** + * Constructor + * + * \param p_path The path + */ + File(const std::filesystem::path& p_path); + + /** + * The path + */ + std::filesystem::path m_path; + + /* + * The path as a string + */ + eastl::string m_pathString; +}; +} // namespace Bigfoot + +#endif diff --git a/Bigfoot/Sources/System/Include/System/Log/EASTLFormatters.hpp b/Bigfoot/Sources/System/Include/System/Log/EASTLFormatters.hpp new file mode 100644 index 0000000..8d2411c --- /dev/null +++ b/Bigfoot/Sources/System/Include/System/Log/EASTLFormatters.hpp @@ -0,0 +1,95 @@ +/********************************************************************* + * \file EASTLFormatters.hpp + * + * \author Romain BOULLARD + * \date December 2025 + *********************************************************************/ +#ifndef BIGFOOT_SYSTEM_EASTLFORMATTERS_HPP +#define BIGFOOT_SYSTEM_EASTLFORMATTERS_HPP +#include + +#if defined(BIGFOOT_NOT_OPTIMIZED) +#include +#endif + +#include + +#include +#include + +// STRING + +template<> +struct std::formatter +{ + constexpr auto parse(std::format_parse_context& ctx) + { + return ctx.begin(); + } + + template + auto format(const eastl::string& p_string, FormatContext& ctx) const + { + return std::format_to(ctx.out(), "{}", p_string.c_str()); + } +}; + +#if defined BIGFOOT_NOT_OPTIMIZED +template<> +struct fmtquill::formatter +{ + constexpr auto parse(format_parse_context& ctx) + { + return ctx.begin(); + } + + auto format(const eastl::string& p_string, format_context& ctx) const + { + return fmtquill::format_to(ctx.out(), "{}", p_string.c_str()); + } +}; + +template<> +struct quill::Codec: quill::DeferredFormatCodec +{ +}; +#endif + +// STRING_VIEW + +template<> +struct std::formatter +{ + constexpr auto parse(std::format_parse_context& ctx) + { + return ctx.begin(); + } + + template + auto format(const eastl::string_view& p_stringView, FormatContext& ctx) const + { + return std::format_to(ctx.out(), "{}", p_stringView.data()); + } +}; + +#if defined BIGFOOT_NOT_OPTIMIZED +template<> +struct fmtquill::formatter +{ + constexpr auto parse(format_parse_context& ctx) + { + return ctx.begin(); + } + + auto format(const eastl::string_view& p_stringView, format_context& ctx) const + { + return fmtquill::format_to(ctx.out(), "{}", p_stringView.data()); + } +}; + +template<> +struct quill::Codec: quill::DeferredFormatCodec +{ +}; +#endif +#endif diff --git a/Bigfoot/Sources/System/Include/System/Log/Log.fbs b/Bigfoot/Sources/System/Include/System/Log/Log.fbs new file mode 100644 index 0000000..727798b --- /dev/null +++ b/Bigfoot/Sources/System/Include/System/Log/Log.fbs @@ -0,0 +1,16 @@ +namespace Bigfoot.Flat; + +enum LogSinkType: byte +{ + Console +} + +enum LogLevel: byte +{ + Debug, + Trace, + Info, + Warn, + Error, + Critical +} \ No newline at end of file diff --git a/Bigfoot/Sources/Utils/Include/Utils/Log.hpp b/Bigfoot/Sources/System/Include/System/Log/Log.hpp similarity index 94% rename from Bigfoot/Sources/Utils/Include/Utils/Log.hpp rename to Bigfoot/Sources/System/Include/System/Log/Log.hpp index ccd1b1d..37c7800 100644 --- a/Bigfoot/Sources/Utils/Include/Utils/Log.hpp +++ b/Bigfoot/Sources/System/Include/System/Log/Log.hpp @@ -4,12 +4,16 @@ * \author Romain BOULLARD * \date October 2025 *********************************************************************/ -#ifndef BIGFOOT_UTILS_LOG_HPP -#define BIGFOOT_UTILS_LOG_HPP +#ifndef BIGFOOT_SYSTEM_LOG_HPP +#define BIGFOOT_SYSTEM_LOG_HPP +#include + #if defined BIGFOOT_NOT_OPTIMIZED +#include + #include -#include +#include #ifdef BIGFOOT_WINDOWS #pragma warning(disable: 4702) @@ -28,20 +32,10 @@ namespace Bigfoot class Log { public: - enum class LogLevel - { - Debug, - Trace, - Info, - Warn, - Error, - Critical - }; - struct LoggerInfo { std::string m_name; - LogLevel m_level; + Flat::LogLevel m_level; }; Log(); @@ -72,7 +66,7 @@ class Log * \param p_loggerInfo The logger to change * \param p_level The new level */ - void ChangeLoggerLogLevel(LoggerInfo& p_loggerInfo, const LogLevel p_level); + void ChangeLoggerLogLevel(LoggerInfo& p_loggerInfo, const Flat::LogLevel p_level); ~Log(); @@ -87,15 +81,10 @@ class Log */ void SetLoggerLevel(const LoggerInfo& p_loggerInfo); - enum class SinkType - { - Console - }; - /* * The sinks */ - std::array, magic_enum::enum_count()> m_sinks; + eastl::array, 1> m_sinks; }; } // namespace Bigfoot @@ -182,6 +171,12 @@ class Log fmt __VA_OPT__(, ) __VA_ARGS__); \ } \ } while (0) - +#else +#define BIGFOOT_LOG_DEBUG(loggerName, fmt, ...) +#define BIGFOOT_LOG_TRACE(loggerName, fmt, ...) +#define BIGFOOT_LOG_INFO(loggerName, fmt, ...) +#define BIGFOOT_LOG_WARN(loggerName, fmt, ...) +#define BIGFOOT_LOG_ERROR(loggerName, fmt, ...) +#define BIGFOOT_LOG_FATAL(loggerName, fmt, ...) #endif #endif diff --git a/Bigfoot/Sources/System/Include/System/Log/Log_generated.hpp b/Bigfoot/Sources/System/Include/System/Log/Log_generated.hpp new file mode 100644 index 0000000..016228b --- /dev/null +++ b/Bigfoot/Sources/System/Include/System/Log/Log_generated.hpp @@ -0,0 +1,136 @@ +// automatically generated by the FlatBuffers compiler, do not modify + + +#ifndef FLATBUFFERS_GENERATED_LOG_BIGFOOT_FLAT_H_ +#define FLATBUFFERS_GENERATED_LOG_BIGFOOT_FLAT_H_ + +#include "flatbuffers/flatbuffers.h" + +// Ensure the included flatbuffers.h is the same version as when this file was +// generated, otherwise it may not be compatible. +static_assert(FLATBUFFERS_VERSION_MAJOR == 25 && + FLATBUFFERS_VERSION_MINOR == 12 && + FLATBUFFERS_VERSION_REVISION == 19, + "Non-compatible flatbuffers version included"); + +#include "EASTL/unique_ptr.h" +#include "EASTL/string.h" + +namespace Bigfoot { +namespace Flat { + +enum class LogSinkType : int8_t { + Console = 0, + MIN = Console, + MAX = Console +}; + +inline const LogSinkType (&EnumValuesLogSinkType())[1] { + static const LogSinkType values[] = { + LogSinkType::Console + }; + return values; +} + +inline const char * const *EnumNamesLogSinkType() { + static const char * const names[2] = { + "Console", + nullptr + }; + return names; +} + +inline const char *EnumNameLogSinkType(LogSinkType e) { + if (::flatbuffers::IsOutRange(e, LogSinkType::Console, LogSinkType::Console)) return ""; + const size_t index = static_cast(e); + return EnumNamesLogSinkType()[index]; +} + +enum class LogLevel : int8_t { + Debug = 0, + Trace = 1, + Info = 2, + Warn = 3, + Error = 4, + Critical = 5, + MIN = Debug, + MAX = Critical +}; + +inline const LogLevel (&EnumValuesLogLevel())[6] { + static const LogLevel values[] = { + LogLevel::Debug, + LogLevel::Trace, + LogLevel::Info, + LogLevel::Warn, + LogLevel::Error, + LogLevel::Critical + }; + return values; +} + +inline const char * const *EnumNamesLogLevel() { + static const char * const names[7] = { + "Debug", + "Trace", + "Info", + "Warn", + "Error", + "Critical", + nullptr + }; + return names; +} + +inline const char *EnumNameLogLevel(LogLevel e) { + if (::flatbuffers::IsOutRange(e, LogLevel::Debug, LogLevel::Critical)) return ""; + const size_t index = static_cast(e); + return EnumNamesLogLevel()[index]; +} + +inline const ::flatbuffers::TypeTable *LogSinkTypeTypeTable() { + static const ::flatbuffers::TypeCode type_codes[] = { + { ::flatbuffers::ET_CHAR, 0, 0 } + }; + static const ::flatbuffers::TypeFunction type_refs[] = { + Bigfoot::Flat::LogSinkTypeTypeTable + }; + static const char * const names[] = { + "Console" + }; + static const ::flatbuffers::TypeTable tt = { + ::flatbuffers::ST_ENUM, 1, type_codes, type_refs, nullptr, nullptr, names + }; + return &tt; +} + +inline const ::flatbuffers::TypeTable *LogLevelTypeTable() { + static const ::flatbuffers::TypeCode type_codes[] = { + { ::flatbuffers::ET_CHAR, 0, 0 }, + { ::flatbuffers::ET_CHAR, 0, 0 }, + { ::flatbuffers::ET_CHAR, 0, 0 }, + { ::flatbuffers::ET_CHAR, 0, 0 }, + { ::flatbuffers::ET_CHAR, 0, 0 }, + { ::flatbuffers::ET_CHAR, 0, 0 } + }; + static const ::flatbuffers::TypeFunction type_refs[] = { + Bigfoot::Flat::LogLevelTypeTable + }; + static const char * const names[] = { + "Debug", + "Trace", + "Info", + "Warn", + "Error", + "Critical" + }; + static const ::flatbuffers::TypeTable tt = { + ::flatbuffers::ST_ENUM, 6, type_codes, type_refs, nullptr, nullptr, names + }; + return &tt; +} + +} // namespace Flat +} // namespace Bigfoot + +#endif // FLATBUFFERS_GENERATED_LOG_BIGFOOT_FLAT_H_ diff --git a/Bigfoot/Sources/Utils/Include/Utils/TargetLogger.generated.hpp.in b/Bigfoot/Sources/System/Include/System/Log/TargetLogger_generated.hpp.in similarity index 74% rename from Bigfoot/Sources/Utils/Include/Utils/TargetLogger.generated.hpp.in rename to Bigfoot/Sources/System/Include/System/Log/TargetLogger_generated.hpp.in index 796f6ff..fbfa751 100644 --- a/Bigfoot/Sources/Utils/Include/Utils/TargetLogger.generated.hpp.in +++ b/Bigfoot/Sources/System/Include/System/Log/TargetLogger_generated.hpp.in @@ -2,11 +2,11 @@ /********************************************************************* * \file @LOGGER_FILENAME@.generated.hpp - * + * *********************************************************************/ #ifndef BIGFOOT_@LOGGER_FILENAME_UPPER@_GENERATED_HPP #define BIGFOOT_@LOGGER_FILENAME_UPPER@_GENERATED_HPP -#include +#include #if defined BIGFOOT_NOT_OPTIMIZED @@ -15,7 +15,7 @@ namespace Bigfoot /* * Logger */ -inline Log::LoggerInfo @LOGGER_NAME@ {"@LOGGER_NAME@", Log::LogLevel::Trace}; -} +inline Log::LoggerInfo @LOGGER_NAME@ {"@LOGGER_NAME@", Flat::LogLevel::Trace}; +} // namespace Bigfoot #endif #endif \ No newline at end of file diff --git a/Bigfoot/Sources/System/Include/System/SystemAssertHandler.hpp b/Bigfoot/Sources/System/Include/System/SystemAssertHandler.hpp new file mode 100644 index 0000000..6e58208 --- /dev/null +++ b/Bigfoot/Sources/System/Include/System/SystemAssertHandler.hpp @@ -0,0 +1,60 @@ +/********************************************************************* + * \file SystemAssertHandler.hpp + * + * \author Romain BOULLARD + * \date January 2026 + *********************************************************************/ +#ifndef BIGFOOT_SYSTEM_SYSTEMASSERTHANDLER_HPP +#define BIGFOOT_SYSTEM_SYSTEMASSERTHANDLER_HPP +#include + +#include + +#if defined BIGFOOT_NOT_OPTIMIZED +#include + +#include +#include +#include + +namespace Bigfoot +{ +class SystemAssertHandler +{ + public: + SystemAssertHandler() = delete; + + SystemAssertHandler(const SystemAssertHandler& p_handler) = delete; + SystemAssertHandler(SystemAssertHandler&& p_handler) = delete; + + ~SystemAssertHandler() = delete; + + /** + * Handle an 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_args Arguments for the format string. + */ + template + static void Handle(const std::source_location& p_location, + const std::string_view p_stacktrace, + std::format_string p_format, + ARGS&&... p_args) + { + BIGFOOT_LOG_FATAL(SYSTEM_LOGGER, + "Assert: {} (File:{}, Line:{}, Function:{}\n{}", + std::format(p_format, eastl::forward(p_args)...), + p_location.file_name(), + p_location.line(), + p_location.function_name(), + p_stacktrace); + } + + SystemAssertHandler& operator=(const SystemAssertHandler& p_handler) = delete; + SystemAssertHandler& operator=(SystemAssertHandler&& p_handler) = delete; +}; +} // namespace Bigfoot +#endif +#endif diff --git a/Bigfoot/Tests/Utils/Include/UtilsTests/UtilsTestsLogger.generated.hpp b/Bigfoot/Sources/System/Include/System/SystemLogger_generated.hpp similarity index 50% rename from Bigfoot/Tests/Utils/Include/UtilsTests/UtilsTestsLogger.generated.hpp rename to Bigfoot/Sources/System/Include/System/SystemLogger_generated.hpp index 72a04bb..dcdf934 100644 --- a/Bigfoot/Tests/Utils/Include/UtilsTests/UtilsTestsLogger.generated.hpp +++ b/Bigfoot/Sources/System/Include/System/SystemLogger_generated.hpp @@ -1,12 +1,12 @@ // AUTO-GENERATED DO NOT TOUCH /********************************************************************* - * \file UtilsTestsLogger.generated.hpp - * + * \file SystemLogger.generated.hpp + * *********************************************************************/ -#ifndef BIGFOOT_UTILSTESTSLOGGER_GENERATED_HPP -#define BIGFOOT_UTILSTESTSLOGGER_GENERATED_HPP -#include +#ifndef BIGFOOT_SYSTEMLOGGER_GENERATED_HPP +#define BIGFOOT_SYSTEMLOGGER_GENERATED_HPP +#include #if defined BIGFOOT_NOT_OPTIMIZED @@ -15,7 +15,7 @@ namespace Bigfoot /* * Logger */ -inline Log::LoggerInfo UTILSTESTS_LOGGER {"UTILSTESTS_LOGGER", Log::LogLevel::Trace}; -} +inline Log::LoggerInfo SYSTEM_LOGGER {"SYSTEM_LOGGER", Flat::LogLevel::Trace}; +} // namespace Bigfoot #endif #endif diff --git a/Bigfoot/Sources/System/Include/System/Time.hpp b/Bigfoot/Sources/System/Include/System/Time.hpp new file mode 100644 index 0000000..fa14d24 --- /dev/null +++ b/Bigfoot/Sources/System/Include/System/Time.hpp @@ -0,0 +1,68 @@ +/********************************************************************* + * \file Time.hpp + * + * \author Romain BOULLARD + * \date December 2025 + *********************************************************************/ +#ifndef BIGFOOT_SYSTEM_TIME_HPP +#define BIGFOOT_SYSTEM_TIME_HPP +#include +#include +#include + +namespace Bigfoot +{ +class Time +{ + public: + Time(const std::uint64_t p_epoch); + + Time(const Time& p_time) = default; + Time(Time&& p_time) = default; + + [[nodiscard]] + std::uint32_t Year() const; + + [[nodiscard]] + std::uint32_t Month() const; + + [[nodiscard]] + std::uint32_t Day() const; + + [[nodiscard]] + std::uint32_t Hour() const; + + [[nodiscard]] + std::uint32_t Minute() const; + + [[nodiscard]] + std::uint32_t Second() const; + + [[nodiscard]] + std::uint32_t Microsecond() const; + + [[nodiscard]] + std::uint64_t Epoch() const; + + ~Time() = default; + + Time& operator=(const Time& p_time) = default; + Time& operator=(Time&& p_time) = default; + + [[nodiscard]] + auto operator<=>(const Time& p_other) const + { + return m_epoch <=> p_other.m_epoch; + } + + [[nodiscard]] + static Time Now(); + + private: + std::uint64_t m_epoch; + std::tm m_timeInfo; + std::chrono::microseconds m_microseconds; +}; +} // namespace Bigfoot + +#endif diff --git a/Bigfoot/Sources/System/Include/System/UUID/FlatUUID.hpp b/Bigfoot/Sources/System/Include/System/UUID/FlatUUID.hpp new file mode 100644 index 0000000..d8e7f7d --- /dev/null +++ b/Bigfoot/Sources/System/Include/System/UUID/FlatUUID.hpp @@ -0,0 +1,18 @@ +/********************************************************************* + * \file FlatUUID.hpp + * + * \author Romain BOULLARD + * \date December 2025 + *********************************************************************/ +#ifndef BIGFOOT_SYSTEM_FLATUUID_HPP +#define BIGFOOT_SYSTEM_FLATUUID_HPP +#include +#include + +namespace flatbuffers +{ +Bigfoot::Flat::UUID Pack(const Bigfoot::UUID& p_uuid); +Bigfoot::UUID UnPack(const Bigfoot::Flat::UUID& p_flatUUID); +} // namespace flatbuffers + +#endif diff --git a/Bigfoot/Sources/System/Include/System/UUID/UUID.fbs b/Bigfoot/Sources/System/Include/System/UUID/UUID.fbs new file mode 100644 index 0000000..c622b85 --- /dev/null +++ b/Bigfoot/Sources/System/Include/System/UUID/UUID.fbs @@ -0,0 +1,8 @@ +native_include "System/UUID/FlatUUID.hpp"; + +namespace Bigfoot.Flat; + +struct UUID (native_type: "::Bigfoot::UUID") +{ + bytes:[ubyte:16]; +} \ No newline at end of file diff --git a/Bigfoot/Sources/System/Include/System/UUID.hpp b/Bigfoot/Sources/System/Include/System/UUID/UUID.hpp similarity index 69% rename from Bigfoot/Sources/System/Include/System/UUID.hpp rename to Bigfoot/Sources/System/Include/System/UUID/UUID.hpp index d7a6716..21ff3b1 100644 --- a/Bigfoot/Sources/System/Include/System/UUID.hpp +++ b/Bigfoot/Sources/System/Include/System/UUID/UUID.hpp @@ -37,9 +37,9 @@ class UUID ~UUID() = default; - [[nodiscard]] operator std::span() const; - [[nodiscard]] operator std::string() const; - [[nodiscard]] operator bool() const; + operator std::span() const; + operator std::string() const; + operator bool() const; UUID& operator=(const UUID& p_uuid) = default; UUID& operator=(UUID&& p_uuid) noexcept = default; @@ -103,4 +103,42 @@ struct std::hash } }; +template<> +struct std::formatter +{ + constexpr auto parse(std::format_parse_context& ctx) + { + return ctx.begin(); + } + + template + auto format(const Bigfoot::UUID& p_uuid, FormatContext& ctx) const + { + return std::format_to(ctx.out(), "{}", static_cast(p_uuid)); + } +}; + +#if defined BIGFOOT_NOT_OPTIMIZED +#include + +template<> +struct fmtquill::formatter +{ + constexpr auto parse(format_parse_context& ctx) + { + return ctx.begin(); + } + + auto format(const Bigfoot::UUID& p_uuid, format_context& ctx) const + { + return fmtquill::format_to(ctx.out(), "{}", static_cast(p_uuid)); + } +}; + +template<> +struct quill::Codec: quill::DeferredFormatCodec +{ +}; +#endif + #endif diff --git a/Bigfoot/Sources/System/Include/System/UUID/UUID_generated.hpp b/Bigfoot/Sources/System/Include/System/UUID/UUID_generated.hpp new file mode 100644 index 0000000..f02e7fa --- /dev/null +++ b/Bigfoot/Sources/System/Include/System/UUID/UUID_generated.hpp @@ -0,0 +1,74 @@ +// automatically generated by the FlatBuffers compiler, do not modify + + +#ifndef FLATBUFFERS_GENERATED_UUID_BIGFOOT_FLAT_H_ +#define FLATBUFFERS_GENERATED_UUID_BIGFOOT_FLAT_H_ + +#include "flatbuffers/flatbuffers.h" + +// Ensure the included flatbuffers.h is the same version as when this file was +// generated, otherwise it may not be compatible. +static_assert(FLATBUFFERS_VERSION_MAJOR == 25 && + FLATBUFFERS_VERSION_MINOR == 12 && + FLATBUFFERS_VERSION_REVISION == 19, + "Non-compatible flatbuffers version included"); + +#include "System/UUID/FlatUUID.hpp" + +#include "EASTL/unique_ptr.h" +#include "EASTL/string.h" + +namespace Bigfoot { +namespace Flat { + +struct UUID; + +inline const ::flatbuffers::TypeTable *UUIDTypeTable(); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(1) UUID FLATBUFFERS_FINAL_CLASS { + private: + uint8_t bytes_[16]; + + public: + struct Traits; + static const ::flatbuffers::TypeTable *MiniReflectTypeTable() { + return UUIDTypeTable(); + } + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "Bigfoot.Flat.UUID"; + } + UUID() + : bytes_() { + } + UUID(::flatbuffers::span _bytes) { + ::flatbuffers::CastToArray(bytes_).CopyFromSpan(_bytes); + } + const ::flatbuffers::Array *bytes() const { + return &::flatbuffers::CastToArray(bytes_); + } +}; +FLATBUFFERS_STRUCT_END(UUID, 16); + +struct UUID::Traits { + using type = UUID; +}; + +inline const ::flatbuffers::TypeTable *UUIDTypeTable() { + static const ::flatbuffers::TypeCode type_codes[] = { + { ::flatbuffers::ET_UCHAR, 1, -1 } + }; + static const int16_t array_sizes[] = { 16, }; + static const int64_t values[] = { 0, 16 }; + static const char * const names[] = { + "bytes" + }; + static const ::flatbuffers::TypeTable tt = { + ::flatbuffers::ST_STRUCT, 1, type_codes, nullptr, array_sizes, values, names + }; + return &tt; +} + +} // namespace Flat +} // namespace Bigfoot + +#endif // FLATBUFFERS_GENERATED_UUID_BIGFOOT_FLAT_H_ diff --git a/Bigfoot/Sources/Utils/Log.cpp b/Bigfoot/Sources/System/Log/Log.cpp similarity index 71% rename from Bigfoot/Sources/Utils/Log.cpp rename to Bigfoot/Sources/System/Log/Log.cpp index 0233d92..4162610 100644 --- a/Bigfoot/Sources/Utils/Log.cpp +++ b/Bigfoot/Sources/System/Log/Log.cpp @@ -4,7 +4,7 @@ * \author Romain BOULLARD * \date October 2025 *********************************************************************/ -#include +#include #if defined BIGFOOT_NOT_OPTIMIZED @@ -14,16 +14,18 @@ Log::Log() { quill::Backend::start(); - m_sinks[magic_enum::enum_integer(SinkType::Console)] = quill::Frontend::create_or_get_sink( - std::string {magic_enum::enum_name(SinkType::Console)}); + m_sinks[static_cast(Flat::LogSinkType::Console)] = + quill::Frontend::create_or_get_sink( + std::string {Flat::EnumNameLogSinkType(Flat::LogSinkType::Console)}); } /****************************************************************************************/ quill::Logger* Log::RegisterLogger(const LoggerInfo& p_loggerInfo) { - quill::Logger* logger = quill::Frontend::create_or_get_logger(p_loggerInfo.m_name, - m_sinks[magic_enum::enum_integer(SinkType::Console)]); + quill::Logger* logger = quill::Frontend::create_or_get_logger( + p_loggerInfo.m_name, + m_sinks[static_cast(Flat::LogSinkType::Console)]); SetLoggerLevel(p_loggerInfo); return logger; @@ -38,7 +40,7 @@ quill::Logger* Log::GetLogger(const LoggerInfo& p_loggerInfo) /****************************************************************************************/ -void Log::ChangeLoggerLogLevel(LoggerInfo& p_loggerInfo, const LogLevel p_level) +void Log::ChangeLoggerLogLevel(LoggerInfo& p_loggerInfo, const Flat::LogLevel p_level) { p_loggerInfo.m_level = p_level; SetLoggerLevel(p_loggerInfo); @@ -48,21 +50,21 @@ void Log::ChangeLoggerLogLevel(LoggerInfo& p_loggerInfo, const LogLevel p_level) void Log::SetLoggerLevel(const LoggerInfo& p_loggerInfo) { - constexpr auto logLevelToQuillLogLevel = [](const LogLevel p_level) constexpr -> quill::LogLevel + constexpr auto logLevelToQuillLogLevel = [](const Flat::LogLevel p_level) constexpr -> quill::LogLevel { switch (p_level) { - case LogLevel::Debug: + case Flat::LogLevel::Debug: return quill::LogLevel::Debug; - case LogLevel::Trace: + case Flat::LogLevel::Trace: return quill::LogLevel::TraceL3; - case LogLevel::Info: + case Flat::LogLevel::Info: return quill::LogLevel::Info; - case LogLevel::Warn: + case Flat::LogLevel::Warn: return quill::LogLevel::Warning; - case LogLevel::Error: + case Flat::LogLevel::Error: return quill::LogLevel::Error; - case LogLevel::Critical: + case Flat::LogLevel::Critical: return quill::LogLevel::Critical; } diff --git a/Bigfoot/Sources/System/Time.cpp b/Bigfoot/Sources/System/Time.cpp new file mode 100644 index 0000000..672f027 --- /dev/null +++ b/Bigfoot/Sources/System/Time.cpp @@ -0,0 +1,121 @@ +/********************************************************************* + * \file Time.cpp + * + * \author Romain BOULLARD + * \date December 2025 + *********************************************************************/ +#include + +#include + +namespace +{ +[[nodiscard]] +std::tm GetTimeInfo(const std::time_t& p_time) +{ + std::tm timeInfo {}; +#ifdef BIGFOOT_WINDOWS + [[maybe_unused]] + const errno_t error = gmtime_s(&timeInfo, &p_time); + if (error != 0) + { + char errnoStr[256]; + strerror_s(errnoStr, error); + + CRITICAL_ASSERT(Bigfoot::SystemAssertHandler, + false, + "Failed to convert epoch time to calendar time. {}", + errnoStr); + } +#elif BIGFOOT_LINUX + [[maybe_unused]] + const std::tm* error = gmtime_r(&p_time, &timeInfo); + CRITICAL_ASSERT(Bigfoot::SystemAssertHandler, error, "Failed to convert epoch time to calendar time"); +#else + static_assert(false, "not implemented"); +#endif + + return timeInfo; +} +} // namespace + +namespace Bigfoot +{ +Time::Time(const std::uint64_t p_epoch): + m_epoch(p_epoch), + m_timeInfo(GetTimeInfo(std::chrono::system_clock::to_time_t( + std::chrono::time_point {std::chrono::microseconds {m_epoch}}))), + m_microseconds(std::chrono::duration_cast( + std::chrono::duration_cast(std::chrono::time_point { + std::chrono::microseconds {m_epoch}}.time_since_epoch()) % + std::chrono::seconds(1))) +{ +} + +/****************************************************************************************/ + +std::uint32_t Time::Year() const +{ + return m_timeInfo.tm_year + 1900; +} + +/****************************************************************************************/ + +std::uint32_t Time::Month() const +{ + return m_timeInfo.tm_mon + 1; +} + +/****************************************************************************************/ + +std::uint32_t Time::Day() const +{ + return m_timeInfo.tm_mday; +} + +/****************************************************************************************/ + +std::uint32_t Time::Hour() const +{ + return m_timeInfo.tm_hour; +} + +/****************************************************************************************/ + +std::uint32_t Time::Minute() const +{ + return m_timeInfo.tm_min; +} + +/****************************************************************************************/ + +std::uint32_t Time::Second() const +{ + return m_timeInfo.tm_sec; +} + +/****************************************************************************************/ + +std::uint32_t Time::Microsecond() const +{ + return static_cast(m_microseconds.count()); +} + +/****************************************************************************************/ + +std::uint64_t Time::Epoch() const +{ + return m_epoch; +} + +/****************************************************************************************/ + +Time Time::Now() +{ + const std::chrono::time_point time = std::chrono::system_clock::now(); + const std::uint64_t epochInMicroSeconds = + std::chrono::duration_cast(time.time_since_epoch()).count(); + + return Time {epochInMicroSeconds}; +} +} // namespace Bigfoot diff --git a/Bigfoot/Sources/System/UUID/FlatUUID.cpp b/Bigfoot/Sources/System/UUID/FlatUUID.cpp new file mode 100644 index 0000000..78bfeb9 --- /dev/null +++ b/Bigfoot/Sources/System/UUID/FlatUUID.cpp @@ -0,0 +1,27 @@ +/********************************************************************* + * \file FlatUUID.cpp + * + * \author Romain BOULLARD + * \date December 2025 + *********************************************************************/ +#include + +namespace flatbuffers +{ +Bigfoot::Flat::UUID Pack(const Bigfoot::UUID& p_uuid) +{ + const std::span bytes = p_uuid; + return Bigfoot::Flat::UUID { + std::span {reinterpret_cast(bytes.data()), + bytes.size()}}; +} + +/****************************************************************************************/ + +Bigfoot::UUID UnPack(const Bigfoot::Flat::UUID& p_flatUUID) +{ + const std::span bytesView {p_flatUUID.bytes()->data(), + p_flatUUID.bytes()->size()}; + return Bigfoot::UUID {std::as_bytes(bytesView)}; +} +} // namespace flatbuffers diff --git a/Bigfoot/Sources/System/UUID.cpp b/Bigfoot/Sources/System/UUID/UUID.cpp similarity index 98% rename from Bigfoot/Sources/System/UUID.cpp rename to Bigfoot/Sources/System/UUID/UUID.cpp index 8fe6b7d..cd87cb6 100644 --- a/Bigfoot/Sources/System/UUID.cpp +++ b/Bigfoot/Sources/System/UUID/UUID.cpp @@ -4,7 +4,7 @@ * \author Romain BOULLARD * \date October 2025 *********************************************************************/ -#include +#include namespace Bigfoot { diff --git a/Bigfoot/Sources/Utils/CMakeLists.txt b/Bigfoot/Sources/Utils/CMakeLists.txt index 0a07c9a..f12f19a 100644 --- a/Bigfoot/Sources/Utils/CMakeLists.txt +++ b/Bigfoot/Sources/Utils/CMakeLists.txt @@ -1,21 +1,15 @@ get_filename_component(PackageName ${CMAKE_CURRENT_SOURCE_DIR} NAME) +project(${PackageName}) set(PublicDependencies - $<$:quill::quill> $<$:cpptrace::cpptrace>) set(PrivateDependencies) -set(BigfootPublicDependencies - System) +set(BigfootPublicDependencies) set(BigfootPrivateDependencies) bigfoot_create_package_lib( - ${PackageName} "${PublicDependencies}" "${PrivateLibraries}" "${BigfootPublicDependencies}" "${BigfootPrivateDependencies}" - "") - -target_compile_definitions(${PackageName} - PUBLIC $<$:QUILL_NO_EXCEPTIONS> - PUBLIC $<$:QUILL_DISABLE_NON_PREFIXED_MACROS>) + "") \ No newline at end of file diff --git a/Bigfoot/Sources/Utils/Include/Utils/Assert.hpp b/Bigfoot/Sources/Utils/Include/Utils/Assert.hpp index ca0f60f..4bdefc2 100644 --- a/Bigfoot/Sources/Utils/Include/Utils/Assert.hpp +++ b/Bigfoot/Sources/Utils/Include/Utils/Assert.hpp @@ -11,7 +11,6 @@ #include -#include #include #include diff --git a/Bigfoot/Sources/Utils/Include/Utils/Caster.hpp b/Bigfoot/Sources/Utils/Include/Utils/Caster.hpp index 9422313..635a149 100644 --- a/Bigfoot/Sources/Utils/Include/Utils/Caster.hpp +++ b/Bigfoot/Sources/Utils/Include/Utils/Caster.hpp @@ -6,52 +6,41 @@ *********************************************************************/ #ifndef BIGFOOT_UTILS_CASTER_HPP #define BIGFOOT_UTILS_CASTER_HPP -#include - -#include +#include namespace Bigfoot { -template +template || eastl::is_base_of_v, bool> = true> constexpr TO* Cast(FROM* p_object) { - constexpr bool same = std::is_base_of_v || std::is_base_of_v; - static_assert(same, "Trying to cast to an incompatible type!"); return static_cast(p_object); } -template +template || eastl::is_base_of_v, bool> = true> constexpr const TO* Cast(const FROM* p_object) { - constexpr bool same = std::is_base_of_v || std::is_base_of_v; - static_assert(same, "Trying to cast to an incompatible type!"); return static_cast(p_object); } -template +template || eastl::is_base_of_v, bool> = true> constexpr TO& Cast(FROM& p_object) { - constexpr bool same = std::is_base_of_v || std::is_base_of_v; - static_assert(same, "Trying to cast to an incompatible type!"); return static_cast(p_object); } -template +template || eastl::is_base_of_v, bool> = true> constexpr const TO& Cast(const FROM& p_object) { - constexpr bool same = std::is_base_of_v || std::is_base_of_v; - static_assert(same, "Trying to cast to an incompatible type!"); return static_cast(p_object); } - -template && std::is_integral_v, bool> = true> -constexpr TO NumericCast(const FROM& p_from) -{ - const TO to = static_cast(p_from); - SOFT_ASSERT(UtilsAssertHandler, static_cast(to) == p_from, "We are losing data for this cast!"); - - return to; -} } // namespace Bigfoot #define BIGFOOT_NUMERIC_CAST(p_to, p_data) Bigfoot::NumericCast(p_data) diff --git a/Bigfoot/Sources/Utils/Include/Utils/Singleton.hpp b/Bigfoot/Sources/Utils/Include/Utils/Singleton.hpp index d52117b..1d6fa9f 100644 --- a/Bigfoot/Sources/Utils/Include/Utils/Singleton.hpp +++ b/Bigfoot/Sources/Utils/Include/Utils/Singleton.hpp @@ -6,10 +6,11 @@ *********************************************************************/ #ifndef BIGFOOT_UTILS_SINGLETON_HPP #define BIGFOOT_UTILS_SINGLETON_HPP -#include -#include -#include -#include + +#include +#include +#include +#include namespace Bigfoot { @@ -31,7 +32,7 @@ class Singleton */ static constexpr TYPE& Instance() { - return *std::bit_cast(ms_instance.data()); + return *eastl::bit_cast(ms_instance.data()); } class Lifetime @@ -42,10 +43,11 @@ class Singleton * * \param p_args Arguments for the singleton */ - template> || ...)>> + template> || ...)>> explicit Lifetime(ARGS&&... p_args) { - Initialize(std::forward(p_args)...); + Initialize(eastl::forward(p_args)...); } Lifetime(const Lifetime& p_lifetime) = delete; @@ -76,7 +78,7 @@ class Singleton template static void Initialize(ARGS&&... p_args) { - new (ms_instance.data()) TYPE(std::forward(p_args)...); + new (ms_instance.data()) TYPE(eastl::forward(p_args)...); ms_initialized = true; } @@ -87,7 +89,7 @@ class Singleton */ static void Finalize() { - std::bit_cast(ms_instance.data())->~TYPE(); + eastl::bit_cast(ms_instance.data())->~TYPE(); ms_initialized = false; } @@ -95,7 +97,7 @@ class Singleton /** * The singleton. */ - alignas(alignof(TYPE)) inline static std::array ms_instance; + alignas(alignof(TYPE)) inline static eastl::array ms_instance; /** * Is the singleton initialized? diff --git a/Bigfoot/Sources/Utils/Include/Utils/TaggedType.hpp b/Bigfoot/Sources/Utils/Include/Utils/TaggedType.hpp new file mode 100644 index 0000000..a020837 --- /dev/null +++ b/Bigfoot/Sources/Utils/Include/Utils/TaggedType.hpp @@ -0,0 +1,131 @@ +/********************************************************************* + * \file TaggedType.h + * + * \author Romain BOULLARD + * \date December 2025 + *********************************************************************/ +#ifndef BIGFOOT_UTILS_TAGGEDTYPE_H +#define BIGFOOT_UTILS_TAGGEDTYPE_H + +#include + +namespace Bigfoot +{ +template +class TaggedType +{ + public: + constexpr TaggedType() = default; + + constexpr explicit TaggedType(TYPE p_value): + m_value(p_value) + { + } + + constexpr TaggedType(const TaggedType& p_taggedType) = default; + constexpr TaggedType(TaggedType&& p_taggedType) noexcept = default; + + ~TaggedType() = default; + + constexpr TaggedType& operator=(const TaggedType& p_taggedType) = default; + constexpr TaggedType& operator=(TaggedType&& p_taggedType) noexcept = default; + + constexpr TaggedType& operator=(const TYPE& p_value) + { + m_value = p_value; + return *this; + } + + constexpr explicit operator TYPE() const + { + return m_value; + } + + constexpr TYPE Get() const + { + return m_value; + } + + constexpr auto operator<=>(const TaggedType& p_other) const = default; + + constexpr TaggedType& operator+=(const TYPE& p_value) + { + m_value += p_value; + return *this; + } + + constexpr TaggedType& operator-=(const TYPE& p_value) + { + m_value -= p_value; + return *this; + } + + constexpr TaggedType& operator*=(const TYPE& p_value) + { + m_value *= p_value; + return *this; + } + + constexpr TaggedType& operator/=(const TYPE& p_value) + { + m_value /= p_value; + return *this; + } + + constexpr TaggedType& operator+=(const TaggedType& p_other) + { + m_value += p_other.m_value; + return *this; + } + + constexpr TaggedType& operator-=(const TaggedType& p_other) + { + m_value -= p_other.m_value; + return *this; + } + + constexpr TaggedType& operator*=(const TaggedType& p_other) + { + m_value *= p_other.m_value; + return *this; + } + + constexpr TaggedType& operator/=(const TaggedType& p_other) + { + m_value /= p_other.m_value; + return *this; + } + + template + friend constexpr TaggedType operator+(L p_left, R p_right) + { + return p_left += p_right; + } + + template + friend constexpr TaggedType operator-(L p_left, R p_right) + { + return p_left -= p_right; + } + + template + friend constexpr TaggedType operator*(L p_left, R p_right) + { + return p_left *= p_right; + } + + template + friend constexpr TaggedType operator/(L p_left, R p_right) + { + return p_left /= p_right; + } + + private: + /** + * The value + */ + TYPE m_value {}; +}; +} // namespace Bigfoot + +#endif diff --git a/Bigfoot/Sources/Utils/Include/Utils/UtilsAssertHandler.hpp b/Bigfoot/Sources/Utils/Include/Utils/UtilsAssertHandler.hpp deleted file mode 100644 index c5f4880..0000000 --- a/Bigfoot/Sources/Utils/Include/Utils/UtilsAssertHandler.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/********************************************************************* - * \file UtilsAssertHandler.hpp - * - * \author Romain BOULLARD - * \date October 2025 - *********************************************************************/ -#ifndef BIGFOOT_UTILS_UTILSASSERTHANDLER_HPP -#define BIGFOOT_UTILS_UTILSASSERTHANDLER_HPP -#include - -#include -#include -#include - -namespace Bigfoot -{ -class UtilsAssertHandler -{ - public: - UtilsAssertHandler() = delete; - - UtilsAssertHandler(const UtilsAssertHandler& p_handler) = delete; - UtilsAssertHandler(UtilsAssertHandler&& p_handler) = delete; - - ~UtilsAssertHandler() = delete; - - /** - * Handle an 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_args Arguments for the format string. - */ - template - static void Handle([[maybe_unused]] const std::source_location& p_location, - [[maybe_unused]] const std::string_view p_stacktrace, - [[maybe_unused]] std::format_string p_format, - [[maybe_unused]] ARGS&&... p_args) - { - // We dont have access to logging capabilities here - // So no log - } - - UtilsAssertHandler& operator=(const UtilsAssertHandler& p_handler) = delete; - UtilsAssertHandler& operator=(UtilsAssertHandler&& p_handler) = delete; -}; -} // namespace Bigfoot -#endif diff --git a/Bigfoot/Sources/Utils/Include/Utils/Version.hpp b/Bigfoot/Sources/Utils/Include/Utils/Version.hpp index 41d77b7..2751ec9 100644 --- a/Bigfoot/Sources/Utils/Include/Utils/Version.hpp +++ b/Bigfoot/Sources/Utils/Include/Utils/Version.hpp @@ -57,7 +57,7 @@ class Version { constexpr std::uint32_t mask = 0b00000000111111110000000000000000; - return BIGFOOT_NUMERIC_CAST(std::uint8_t, (m_combined & mask) >> 16); + return static_cast((m_combined & mask) >> 16); } /** @@ -70,7 +70,7 @@ class Version { constexpr std::uint32_t mask = 0b00000000000000001111111100000000; - return BIGFOOT_NUMERIC_CAST(std::uint8_t, (m_combined & mask) >> 8); + return static_cast((m_combined & mask) >> 8); } /** @@ -83,7 +83,7 @@ class Version { constexpr std::uint32_t mask = 0b00000000000000000000000011111111; - return BIGFOOT_NUMERIC_CAST(std::uint8_t, (m_combined & mask)); + return static_cast(m_combined & mask); } [[nodiscard]] diff --git a/Bigfoot/Tests/Engine/BigFile/Database.cpp b/Bigfoot/Tests/Engine/BigFile/Database.cpp deleted file mode 100644 index 8b13789..0000000 --- a/Bigfoot/Tests/Engine/BigFile/Database.cpp +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Bigfoot/Tests/Engine/BigFile/Statement.cpp b/Bigfoot/Tests/Engine/BigFile/Statement.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/Bigfoot/Tests/Engine/CMakeLists.txt b/Bigfoot/Tests/Engine/CMakeLists.txt index c96aff6..36652b4 100644 --- a/Bigfoot/Tests/Engine/CMakeLists.txt +++ b/Bigfoot/Tests/Engine/CMakeLists.txt @@ -1,7 +1,15 @@ get_filename_component(PackageName ${CMAKE_CURRENT_SOURCE_DIR} NAME) +project(${PackageName}Tests) -bigfoot_create_bigfile(${PackageName}Tests "Tests/Bigfoot") +set(BigfootDependencies + Engine + System + Utils) + +bigfoot_create_bigfile("Tests/Bigfoot") bigfoot_create_package_tests( - ${PackageName} - "") \ No newline at end of file + "" + "${BigfootDependencies}") + +bigfoot_setup_dependencies("Tests/Bigfoot") \ No newline at end of file diff --git a/Bigfoot/Tests/Engine/Include/Bigfoot/BigFileInfo_generated.hpp b/Bigfoot/Tests/Engine/Include/Bigfoot/BigFileInfo_generated.hpp deleted file mode 100644 index 98ccbbb..0000000 --- a/Bigfoot/Tests/Engine/Include/Bigfoot/BigFileInfo_generated.hpp +++ /dev/null @@ -1,19 +0,0 @@ -// AUTO-GENERATED DO NOT TOUCH - -/********************************************************************* - * \file BigFileInfo.generated.hpp - * - *********************************************************************/ -#ifndef BIGFOOT_BIGFOOT_BIGFILEINFO_GENERATED_HPP -#define BIGFOOT_BIGFOOT_BIGFILEINFO_GENERATED_HPP - -#include - -namespace Bigfoot -{ -/* - * BigFile location - */ -constexpr std::string_view BIGFILE_BIGFOOT_LOCATION{"D:/Development/bigfootdev/bigfoot2/build/Bigfoot/Tests/Engine/Bigfoot-bigfile.db"}; -} -#endif diff --git a/Bigfoot/Tests/Engine/Include/EngineTests/BigFileInfo.generated.hpp b/Bigfoot/Tests/Engine/Include/EngineTests/BigFileInfo.generated.hpp deleted file mode 100644 index c0fb85c..0000000 --- a/Bigfoot/Tests/Engine/Include/EngineTests/BigFileInfo.generated.hpp +++ /dev/null @@ -1,19 +0,0 @@ -// AUTO-GENERATED DO NOT TOUCH - -/********************************************************************* - * \file BigFileInfo.generated.hpp - * - *********************************************************************/ -#ifndef BIGFOOT_ENGINE_BIGFILE_BIGFILEINFO_GENERATED_HPP -#define BIGFOOT_ENGINE_BIGFILE_BIGFILEINFO_GENERATED_HPP - -#include - -namespace Bigfoot -{ -/* - * BigFile location - */ -constexpr std::string_view BIGFILE_ENGINETESTS_LOCATION{"D:/Development/bigfootdev/bigfoot2/build/Bigfoot/Tests/Engine/EngineTests-bigfile.db"}; -} -#endif diff --git a/Bigfoot/Tests/Engine/touch.cpp b/Bigfoot/Tests/Engine/touch.cpp new file mode 100644 index 0000000..38a47cf --- /dev/null +++ b/Bigfoot/Tests/Engine/touch.cpp @@ -0,0 +1 @@ +// to delete when an actual test is in EngineTests diff --git a/Bigfoot/Tests/System/CMakeLists.txt b/Bigfoot/Tests/System/CMakeLists.txt index 17a08a7..7b130e0 100644 --- a/Bigfoot/Tests/System/CMakeLists.txt +++ b/Bigfoot/Tests/System/CMakeLists.txt @@ -1,7 +1,14 @@ get_filename_component(PackageName ${CMAKE_CURRENT_SOURCE_DIR} NAME) +project(${PackageName}Tests) -set(Dependencies) +set(BigfootDependencies + System + Utils) bigfoot_create_package_tests( - ${PackageName} - "") \ No newline at end of file + "" + "${BigfootDependencies}") + +bigfoot_create_logger() + +bigfoot_setup_dependencies("Tests/Bigfoot") \ No newline at end of file diff --git a/Bigfoot/Tests/System/File.cpp b/Bigfoot/Tests/System/File.cpp new file mode 100644 index 0000000..850afe6 --- /dev/null +++ b/Bigfoot/Tests/System/File.cpp @@ -0,0 +1,80 @@ +/********************************************************************* + * \file File.cpp + * + * \author Romain BOULLARD + * \date December 2025 + *********************************************************************/ +#include + +#include + +namespace Bigfoot +{ +class FileFixture: public ::testing::Test +{ + public: + File m_file {eastl::string_view {"Fixture/file"}}; + File m_nonExistent {eastl::string_view {"Fixture/bigfoot"}}; +}; + +/****************************************************************************************/ + +TEST_F(FileFixture, IsRelative_ShouldReturnTrueOnRelativeFile) +{ + EXPECT_TRUE(m_file.IsRelative()); +} + +/****************************************************************************************/ + +TEST_F(FileFixture, IsRelative_ShouldReturnFalseOnAbsoluteFile) +{ + EXPECT_FALSE(m_file.Absolute().IsRelative()); +} + +/****************************************************************************************/ + +TEST_F(FileFixture, IsAbsolute_ShouldReturnTrueOnAbsoluteFile) +{ + EXPECT_TRUE(m_file.Absolute().IsAbsolute()); +} + +TEST_F(FileFixture, IsAbsolute_ShouldReturnFalseOnRelativeFile) +{ + EXPECT_FALSE(m_file.IsAbsolute()); +} + +/****************************************************************************************/ + +TEST_F(FileFixture, Exists_ShouldReturnTrueOnExistingFile) +{ + EXPECT_TRUE(m_file.Exists()); +} + +/****************************************************************************************/ + +TEST_F(FileFixture, Exists_ShouldReturnFalseOnNonExistingFile) +{ + EXPECT_FALSE(m_nonExistent.Exists()); +} + +/****************************************************************************************/ + +TEST_F(FileFixture, Path_ShouldReturnThePath) +{ + EXPECT_STREQ(m_file.Path().data(), "Fixture/file"); +} + +/****************************************************************************************/ + +TEST_F(FileFixture, Absolute_ShouldReturnTheAbsolutePath) +{ + EXPECT_STREQ(std::filesystem::absolute("Fixture/file").string().c_str(), m_file.Absolute().Path().data()); +} + +/****************************************************************************************/ + +TEST_F(FileFixture, Relative_ShouldReturnTheRelativePath) +{ + EXPECT_STREQ(std::filesystem::relative("Fixture/file").string().c_str(), m_file.Relative().Path().data()); +} +} // namespace Bigfoot diff --git a/Bigfoot/Sources/Engine/BigFile/Statement.cpp b/Bigfoot/Tests/System/Fixture/file similarity index 100% rename from Bigfoot/Sources/Engine/BigFile/Statement.cpp rename to Bigfoot/Tests/System/Fixture/file diff --git a/Bigfoot/Tests/System/Include/SystemTests/SystemTestsLogger_generated.hpp b/Bigfoot/Tests/System/Include/SystemTests/SystemTestsLogger_generated.hpp new file mode 100644 index 0000000..abe35cd --- /dev/null +++ b/Bigfoot/Tests/System/Include/SystemTests/SystemTestsLogger_generated.hpp @@ -0,0 +1,21 @@ +// AUTO-GENERATED DO NOT TOUCH + +/********************************************************************* + * \file SystemTestsLogger.generated.hpp + * + *********************************************************************/ +#ifndef BIGFOOT_SYSTEMTESTSLOGGER_GENERATED_HPP +#define BIGFOOT_SYSTEMTESTSLOGGER_GENERATED_HPP +#include + +#if defined BIGFOOT_NOT_OPTIMIZED + +namespace Bigfoot +{ +/* + * Logger + */ +inline Log::LoggerInfo SYSTEMTESTS_LOGGER {"SYSTEMTESTS_LOGGER", Flat::LogLevel::Trace}; +} // namespace Bigfoot +#endif +#endif diff --git a/Bigfoot/Tests/Utils/Log.cpp b/Bigfoot/Tests/System/Log/Log.cpp similarity index 56% rename from Bigfoot/Tests/Utils/Log.cpp rename to Bigfoot/Tests/System/Log/Log.cpp index 6e531e9..49a2e21 100644 --- a/Bigfoot/Tests/Utils/Log.cpp +++ b/Bigfoot/Tests/System/Log/Log.cpp @@ -4,9 +4,11 @@ * \author Romain BOULLARD * \date December 2022 *********************************************************************/ -#include +#include -#include +#include + +#include #if defined BIGFOOT_NOT_OPTIMIZED @@ -19,51 +21,51 @@ class LogFixture: public ::testing::Test protected: void SetUp() override { - UTILSTESTS_LOGGER = {"UTILSTESTS_LOGGER", Log::LogLevel::Trace}; + SYSTEMTESTS_LOGGER = {"UTILSTESTS_LOGGER", Flat::LogLevel::Trace}; } - constexpr Log::LogLevel QuillLogLevelToLogLevel(const quill::LogLevel p_level) + static constexpr Flat::LogLevel QuillLogLevelToLogLevel(const quill::LogLevel p_level) { switch (p_level) { case quill::LogLevel::Debug: - return Log::LogLevel::Debug; + return Flat::LogLevel::Debug; case quill::LogLevel::TraceL3: - return Log::LogLevel::Trace; + return Flat::LogLevel::Trace; case quill::LogLevel::Info: - return Log::LogLevel::Info; + return Flat::LogLevel::Info; case quill::LogLevel::Warning: - return Log::LogLevel::Warn; + return Flat::LogLevel::Warn; case quill::LogLevel::Error: - return Log::LogLevel::Error; + return Flat::LogLevel::Error; case quill::LogLevel::Critical: - return Log::LogLevel::Critical; + return Flat::LogLevel::Critical; default: break; } - return Log::LogLevel::Trace; + return Flat::LogLevel::Trace; } - Singleton::Lifetime m_log; + Log m_log; }; /****************************************************************************************/ TEST_F(LogFixture, RegisterLogger_ShouldRegisterTheLogger) { - const quill::Logger* logger = Singleton::Instance().RegisterLogger(UTILSTESTS_LOGGER); + const quill::Logger* logger = m_log.RegisterLogger(SYSTEMTESTS_LOGGER); EXPECT_TRUE(logger); - EXPECT_EQ(logger, Singleton::Instance().GetLogger(UTILSTESTS_LOGGER)); - EXPECT_EQ(logger->get_logger_name(), UTILSTESTS_LOGGER.m_name); - EXPECT_EQ(QuillLogLevelToLogLevel(logger->get_log_level()), UTILSTESTS_LOGGER.m_level); + EXPECT_EQ(logger, m_log.GetLogger(SYSTEMTESTS_LOGGER)); + EXPECT_EQ(logger->get_logger_name(), SYSTEMTESTS_LOGGER.m_name); + EXPECT_EQ(QuillLogLevelToLogLevel(logger->get_log_level()), SYSTEMTESTS_LOGGER.m_level); } /****************************************************************************************/ TEST_F(LogFixture, GetLogger_ShouldReturnNullptrIfTheLoggerDoesNotExist) { - EXPECT_FALSE(Singleton::Instance().GetLogger(UTILSTESTS_LOGGER)); + EXPECT_FALSE(m_log.GetLogger(SYSTEMTESTS_LOGGER)); } /****************************************************************************************/ @@ -71,60 +73,66 @@ TEST_F(LogFixture, GetLogger_ShouldReturnNullptrIfTheLoggerDoesNotExist) TEST_F(LogFixture, GetLogger_ShouldReturnTheLoggerIfItExists) { [[maybe_unused]] - const quill::Logger* logger = Singleton::Instance().RegisterLogger(UTILSTESTS_LOGGER); - EXPECT_TRUE(Singleton::Instance().GetLogger(UTILSTESTS_LOGGER)); + const quill::Logger* logger = m_log.RegisterLogger(SYSTEMTESTS_LOGGER); + EXPECT_TRUE(m_log.GetLogger(SYSTEMTESTS_LOGGER)); } /****************************************************************************************/ TEST_F(LogFixture, ChangeLoggerLogLevel_ShouldChangeTheLoggerLogLevel) { - const quill::Logger* logger = Singleton::Instance().RegisterLogger(UTILSTESTS_LOGGER); + const quill::Logger* logger = m_log.RegisterLogger(SYSTEMTESTS_LOGGER); - Singleton::Instance().ChangeLoggerLogLevel(UTILSTESTS_LOGGER, Log::LogLevel::Critical); - EXPECT_EQ(QuillLogLevelToLogLevel(logger->get_log_level()), Log::LogLevel::Critical); + m_log.ChangeLoggerLogLevel(SYSTEMTESTS_LOGGER, Flat::LogLevel::Critical); + EXPECT_EQ(QuillLogLevelToLogLevel(logger->get_log_level()), Flat::LogLevel::Critical); } /****************************************************************************************/ TEST_F(LogFixture, LogDebug) { - BIGFOOT_LOG_DEBUG(UTILSTESTS_LOGGER, "Hello"); + Singleton::Lifetime singletonLifetime; + BIGFOOT_LOG_DEBUG(SYSTEMTESTS_LOGGER, "Hello"); } /****************************************************************************************/ TEST_F(LogFixture, LogTrace) { - BIGFOOT_LOG_TRACE(UTILSTESTS_LOGGER, "Hello"); + Singleton::Lifetime singletonLifetime; + BIGFOOT_LOG_TRACE(SYSTEMTESTS_LOGGER, "Hello"); } /****************************************************************************************/ TEST_F(LogFixture, LogInfo) { - BIGFOOT_LOG_INFO(UTILSTESTS_LOGGER, "Hello"); + Singleton::Lifetime singletonLifetime; + BIGFOOT_LOG_INFO(SYSTEMTESTS_LOGGER, "Hello"); } /****************************************************************************************/ TEST_F(LogFixture, LogWarn) { - BIGFOOT_LOG_WARN(UTILSTESTS_LOGGER, "Hello"); + Singleton::Lifetime singletonLifetime; + BIGFOOT_LOG_WARN(SYSTEMTESTS_LOGGER, "Hello"); } /****************************************************************************************/ TEST_F(LogFixture, LogError) { - BIGFOOT_LOG_ERROR(UTILSTESTS_LOGGER, "Hello"); + Singleton::Lifetime singletonLifetime; + BIGFOOT_LOG_ERROR(SYSTEMTESTS_LOGGER, "Hello"); } /****************************************************************************************/ TEST_F(LogFixture, LogFatal) { - BIGFOOT_LOG_FATAL(UTILSTESTS_LOGGER, "Hello"); + Singleton::Lifetime singletonLifetime; + BIGFOOT_LOG_FATAL(SYSTEMTESTS_LOGGER, "Hello"); } } // namespace Bigfoot #endif diff --git a/Bigfoot/Tests/System/Time.cpp b/Bigfoot/Tests/System/Time.cpp new file mode 100644 index 0000000..6a9b602 --- /dev/null +++ b/Bigfoot/Tests/System/Time.cpp @@ -0,0 +1,67 @@ +/********************************************************************* + * \file Time.cpp + * + * \author Romain BOULLARD + * \date December 2025 + *********************************************************************/ +#include + +#include + +namespace Bigfoot +{ +class TimeFixture: public ::testing::Test +{ + public: + Time m_time {1'767'643'746'680'609}; +}; + +/****************************************************************************************/ + +TEST_F(TimeFixture, Year_ShouldReturnTheYear) +{ + EXPECT_EQ(m_time.Year(), 2026); +} + +/****************************************************************************************/ + +TEST_F(TimeFixture, Month_ShouldReturnTheMonth) +{ + EXPECT_EQ(m_time.Month(), 1); +} + +/****************************************************************************************/ + +TEST_F(TimeFixture, Day_ShouldReturnTheDay) +{ + EXPECT_EQ(m_time.Day(), 5); +} + +/****************************************************************************************/ + +TEST_F(TimeFixture, Hour_ShouldReturnTheHour) +{ + EXPECT_EQ(m_time.Hour(), 20); +} + +/****************************************************************************************/ + +TEST_F(TimeFixture, Minute_ShouldReturnTheMinute) +{ + EXPECT_EQ(m_time.Minute(), 9); +} + +/****************************************************************************************/ + +TEST_F(TimeFixture, Second_ShouldReturnTheSecond) +{ + EXPECT_EQ(m_time.Second(), 6); +} + +/****************************************************************************************/ + +TEST_F(TimeFixture, Microsecond_ShouldReturnTheMicrosecond) +{ + EXPECT_EQ(m_time.Microsecond(), 680'609); +} +} // namespace Bigfoot diff --git a/Bigfoot/Tests/System/UUID.cpp b/Bigfoot/Tests/System/UUID/UUID.cpp similarity index 99% rename from Bigfoot/Tests/System/UUID.cpp rename to Bigfoot/Tests/System/UUID/UUID.cpp index 165edfc..8f978d9 100644 --- a/Bigfoot/Tests/System/UUID.cpp +++ b/Bigfoot/Tests/System/UUID/UUID.cpp @@ -4,7 +4,7 @@ * \author Romain BOULLARD * \date October 2025 *********************************************************************/ -#include +#include #include diff --git a/Bigfoot/Tests/Utils/CMakeLists.txt b/Bigfoot/Tests/Utils/CMakeLists.txt index 5435b0d..47c3d4b 100644 --- a/Bigfoot/Tests/Utils/CMakeLists.txt +++ b/Bigfoot/Tests/Utils/CMakeLists.txt @@ -1,9 +1,11 @@ get_filename_component(PackageName ${CMAKE_CURRENT_SOURCE_DIR} NAME) +project(${PackageName}Tests) -set(Dependencies) - -bigfoot_create_logger(${PackageName}Tests) +set(BigfootDependencies + Utils) bigfoot_create_package_tests( - ${PackageName} - "") \ No newline at end of file + "" + "${BigfootDependencies}") + +bigfoot_setup_dependencies("Tests/Bigfoot") \ No newline at end of file diff --git a/Bigfoot/Tests/Utils/Caster.cpp b/Bigfoot/Tests/Utils/Caster.cpp index 5041ac1..0d2392a 100644 --- a/Bigfoot/Tests/Utils/Caster.cpp +++ b/Bigfoot/Tests/Utils/Caster.cpp @@ -99,23 +99,4 @@ TEST_F(CasterFixture, ObjectCast) const Parent& parent = BIGFOOT_OBJECT_CAST(Parent, m_b); EXPECT_EQ(parent.GetParentValue(), 34); } - -/****************************************************************************************/ - -TEST_F(CasterFixture, NumericCast) -{ - const std::uint32_t a = 128; - const std::uint8_t b = BIGFOOT_NUMERIC_CAST(std::uint8_t, a); - EXPECT_EQ(a, b); -} - -/****************************************************************************************/ - -#ifdef BIGFOOT_NOT_OPTIMIZED -TEST_F(CasterFixture, NumericCast_ShouldAssertIfWeLoseDataDuringTheCast) -{ - const std::uint32_t a = 1000; - EXPECT_DEATH(BIGFOOT_NUMERIC_CAST(std::uint8_t, a), ""); -} -#endif } // namespace Bigfoot diff --git a/Bigfoot/Tests/Utils/UtilsAssertHandler.cpp b/Bigfoot/Tests/Utils/UtilsAssertHandler.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/CI/templates.yml b/CI/templates.yml deleted file mode 100644 index ef818dd..0000000 --- a/CI/templates.yml +++ /dev/null @@ -1,121 +0,0 @@ -.Build: - variables: - BUILD_TYPE: 'Release' - CCACHE_BASEDIR: $CI_PROJECT_DIR - CCACHE_DIR: $CI_PROJECT_DIR/ccache - CCACHE_COMPILERCHECK: "content" - image: registry.gitlab.com/bigfootdev/docker/linuxbigfootbuilder:main - stage: build - before_script: - - ccache --zero-stats - script: - - conan install . --deployer=full_deploy --deployer-folder=build --remote=bigfootpackages -pr:h=clang -pr:b=clang --build=missing -s build_type=$BUILD_TYPE -o bigfoot/*:unity_build=False -o bigfoot/*:build_tests=True -o bigfoot/*:sample_app=True -o bigfoot/*:tracy=False -o bigfoot/*:build_tools=True -o bigfoot/*:vulkan=True -o bigfoot/*:build_benchmarks=True -o bigfoot/*:build_benchmarks_lto=True -o bigfoot/*:render_doc=True - - cmake -S . -B ./build/$BUILD_TYPE --toolchain ./build/$BUILD_TYPE/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -G "Ninja" - - cmake --build build/$BUILD_TYPE --parallel $(nproc) - after_script: - - ccache --show-stats - dependencies: [] - artifacts: - when: always - name: Build$BUILD_TYPE - paths: - - build/$BUILD_TYPE - expire_in: 1 week - cache: - - key: "$CI_JOB_NAME" - paths: - - $CCACHE_DIR - tags: - - linux - - c++ - - bigfootdev - -.BuildUnity: - variables: - BUILD_TYPE: 'Release' - CCACHE_BASEDIR: $CI_PROJECT_DIR - CCACHE_DIR: $CI_PROJECT_DIR/ccache - CCACHE_COMPILERCHECK: "content" - image: registry.gitlab.com/bigfootdev/docker/linuxbigfootbuilder:main - stage: build-unity - before_script: - - ccache --zero-stats - script: - - conan install . --deployer=full_deploy --deployer-folder=build --remote=bigfootpackages -pr:h=clang -pr:b=clang --build=missing -s build_type=$BUILD_TYPE -o bigfoot/*:unity_build=True -o bigfoot/*:build_tests=True -o bigfoot/*:sample_app=True -o bigfoot/*:tracy=False -o bigfoot/*:build_tools=True -o bigfoot/*:vulkan=True -o bigfoot/*:build_benchmarks=True -o bigfoot/*:build_benchmarks_lto=True -o bigfoot/*:render_doc=True - - cmake -S . -B ./build/$BUILD_TYPE --toolchain ./build/$BUILD_TYPE/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -G "Ninja" - - cmake --build build/$BUILD_TYPE --parallel $(nproc) - after_script: - - ccache --show-stats - dependencies: [] - artifacts: - when: always - name: Build$BUILD_TYPE - paths: - - build/$BUILD_TYPE - expire_in: 1 week - cache: - - key: "$CI_JOB_NAME" - paths: - - $CCACHE_DIR - tags: - - linux - - c++ - - bigfootdev - -.UnitTests: - variables: - BUILD_TYPE: 'Release' - image: registry.gitlab.com/bigfootdev/docker/linuxbigfootbuilder:main - stage: unit-tests - script: - - cd ./build/$BUILD_TYPE - - xvfb-run ctest . --output-on-failure - artifacts: - when: always - name: Test$BUILD_TYPE - paths: - - build/$BUILD_TYPE - reports: - junit: ./build/$BUILD_TYPE/TestResults/*.xml - tags: - - linux - - c++ - - bigfootdev - -.SonarCloud: - variables: - CCACHE_BASEDIR: $CI_PROJECT_DIR - CCACHE_DIR: $CI_PROJECT_DIR/ccache - CCACHE_COMPILERCHECK: "content" - image: registry.gitlab.com/bigfootdev/docker/linuxbigfootcoveragebuilder:main - stage: sonar - before_script: - - ccache --zero-stats - - curl -sSLo ./sonar-scanner.zip 'https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.2.0.5079-linux-x64.zip' - - unzip -o sonar-scanner.zip - - mv sonar-scanner-7.2.0.5079-linux-x64 sonar-scanner - - curl -sSLo ./build-wrapper-linux-x86.zip "${SONAR_HOST_URL}/static/cpp/build-wrapper-linux-x86.zip" - - unzip -oj build-wrapper-linux-x86.zip -d ./build-wrapper - script: - - conan install . --deployer=full_deploy --deployer-folder=build --remote=bigfootpackages -pr:h=gcc_coverage -pr:b=gcc_coverage --build=missing -s build_type=Debug -o bigfoot/*:unity_build=False -o bigfoot/*:build_tests=True -o bigfoot/*:sample_app=False -o bigfoot/*:tracy=False -o bigfoot/*:build_tools=True -o bigfoot/*:vulkan=True -o bigfoot/*:build_benchmarks=False -o bigfoot/*:build_benchmarks_lto=False -o bigfoot/*:render_doc=False - - cmake -S . -B ./build/Debug --toolchain ./build/Debug/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Debug -G "Ninja" - - ./build-wrapper/build-wrapper-linux-x86-64 --out-dir bw-output cmake --build ./build/Debug --parallel $(nproc) - - chmod +x sonarqube.sh && xvfb-run ./sonarqube.sh - - ./sonar-scanner/bin/sonar-scanner -Dsonar.host.url="${SONAR_HOST_URL}" -Dsonar.token="${SONAR_BIGFOOT2_TOKEN}" -Dsonar.cfamily.compile-commands=bw-output/compile_commands.json -Dsonar.coverageReportPaths=SonarqubeResult/CoverageReport/coverage.xml -Dsonar.cfamily.cppunit.reportsPath=SonarqubeResult/UnitTests/Merged/CPPUnit - after_script: - - ccache --show-stats - artifacts: - when: always - name: BuildAndCoverage - paths: - - build/Debug - - SonarqubeResult - expire_in: 1 week - cache: - - key: "$CI_JOB_NAME" - paths: - - $CCACHE_DIR - tags: - - linux - - c++ - - bigfootdev \ No newline at end of file diff --git a/CMake/FindDependencies.cmake b/CMake/FindDependencies.cmake index 7839d7b..b56d7f0 100644 --- a/CMake/FindDependencies.cmake +++ b/CMake/FindDependencies.cmake @@ -8,20 +8,18 @@ endif() find_package(EASTL REQUIRED) find_package(unordered_dense REQUIRED) find_package(mimalloc REQUIRED) -find_package(magic_enum REQUIRED) find_package(stduuid REQUIRED) find_package(SQLite3 REQUIRED) find_package(CLI11 REQUIRED) -find_package(xxHash REQUIRED) +find_package(rapidhash REQUIRED) find_package(effolkronium_random REQUIRED) -find_package(zeus_expected REQUIRED) find_package(flatbuffers CONFIG REQUIRED) if(TRACY) find_package(Tracy REQUIRED) endif() -if(${is_multi_config}) +if(${IS_MULTI_CONFIG}) find_package(quill REQUIRED) find_package(cpptrace REQUIRED) elseif(${CMAKE_BUILD_TYPE} STREQUAL "Debug" OR ${CMAKE_BUILD_TYPE} STREQUAL "RelWithDebInfo") @@ -36,7 +34,7 @@ find_package(imgui REQUIRED) if(VULKAN) find_package(VulkanHeaders REQUIRED) - if(${is_multi_config}) + if(${IS_MULTI_CONFIG}) find_package(vulkan-validationlayers REQUIRED) elseif(${CMAKE_BUILD_TYPE} STREQUAL "Debug" OR ${CMAKE_BUILD_TYPE} STREQUAL "RelWithDebInfo") find_package(vulkan-validationlayers REQUIRED) diff --git a/CMake/Package.cmake b/CMake/Package.cmake index 60a332b..8f46ecd 100644 --- a/CMake/Package.cmake +++ b/CMake/Package.cmake @@ -1,9 +1,11 @@ -function(bigfoot_create_package_lib PackageName PackagePublicDependencies PackagePrivateDependencies PackageBigfootPublicDependencies PackageBigfootPrivateDependencies ParentFolder) - project(${PackageName}) - +function(bigfoot_create_package_lib PackagePublicDependencies PackagePrivateDependencies PackageBigfootPublicDependencies PackageBigfootPrivateDependencies ParentFolder) add_library(${PROJECT_NAME} STATIC) set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX) + target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/Include) + + bigfoot_compile_flatbuffers("${PackageBigfootPublicDependencies}") + # collect sources (reconfigure when files are added/removed) file(GLOB_RECURSE _BF_SOURCES CONFIGURE_DEPENDS @@ -20,33 +22,25 @@ function(bigfoot_create_package_lib PackageName PackagePublicDependencies Packag ${_BF_SOURCES} ) - target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/Include) + target_link_libraries(${PROJECT_NAME} PUBLIC unordered_dense::unordered_dense EASTL::EASTL flatbuffers::flatbuffers rapidhash::rapidhash) + target_link_libraries(${PROJECT_NAME} PRIVATE ${CMAKE_DL_LIBS}) target_link_libraries(${PROJECT_NAME} PUBLIC ${PackagePublicDependencies}) target_link_libraries(${PROJECT_NAME} PRIVATE ${PackagePrivateDependencies}) - target_link_libraries(${PROJECT_NAME} PUBLIC "$") - target_link_libraries(${PROJECT_NAME} PRIVATE "$") - target_link_libraries(${PROJECT_NAME} PRIVATE ${CMAKE_DL_LIBS}) - - target_link_options(${PROJECT_NAME} PRIVATE - $<$:/INCREMENTAL:NO>) - - target_compile_options(${PROJECT_NAME} PRIVATE - $<$:/W4 /WX /D_HAS_EXCEPTIONS=0 /GR- /Zc:__cplusplus /fp:fast> - $<$>:-Wall -Wextra -Wpedantic -Werror -fno-exceptions -fno-rtti -ffast-math -fno-strict-aliasing>) + target_link_libraries(${PROJECT_NAME} PUBLIC $) + target_link_libraries(${PROJECT_NAME} PRIVATE $) source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX Src FILES ${_BF_SOURCES}) set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER Bigfoot/${ParentFolder}) - set_target_properties(${PROJECT_NAME} PROPERTIES UNITY_BUILD ${UNITY_BUILD}) endfunction() -function(bigfoot_create_package_tests PackageName ParentFolder) - project(${PackageName}Tests) - +function(bigfoot_create_package_tests ParentFolder BigfootDependencies) add_executable(${PROJECT_NAME}) set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX) + bigfoot_compile_flatbuffers("${BigfootDependencies}") + file(GLOB_RECURSE _BF_TEST_SOURCES CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.h @@ -63,23 +57,37 @@ function(bigfoot_create_package_tests PackageName ParentFolder) target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/Include) - target_link_libraries(${PROJECT_NAME} PRIVATE "$") + target_link_libraries(${PROJECT_NAME} PRIVATE $) target_link_libraries(${PROJECT_NAME} PRIVATE gtest::gtest) - target_link_options(${PROJECT_NAME} PRIVATE - $<$:/INCREMENTAL:NO>) - - target_compile_options(${PROJECT_NAME} PRIVATE - $<$:/W4 /WX /D_HAS_EXCEPTIONS=0 /GR- /Zc:__cplusplus /fp:fast> - $<$>:-Wall -Wextra -Wpedantic -Werror -fno-exceptions -fno-rtti -ffast-math -fno-strict-aliasing>) - include(GoogleTest) gtest_discover_tests(${PROJECT_NAME} XML_OUTPUT_DIR ${CMAKE_BINARY_DIR}/TestResults/) source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX Src/ FILES ${_BF_TEST_SOURCES}) set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER Tests/Bigfoot/${ParentFolder}) - set_target_properties(${PROJECT_NAME} PROPERTIES UNITY_BUILD ${UNITY_BUILD}) - bigfoot_setup_dependencies(${PROJECT_NAME} "Tests/Bigfoot") + ##################COPY FIXTURE FOLDER################### + + if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Fixture) + file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Fixture) + endif() + + # Track all fixture files + file(GLOB_RECURSE FIXTURE_FILES + CONFIGURE_DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/Fixture/* + ) + + add_custom_target(${PROJECT_NAME}Fixture + COMMAND ${CMAKE_COMMAND} -E remove_directory $/Fixture + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/Fixture $/Fixture + DEPENDS ${FIXTURE_FILES} + COMMENT "Copying Fixture folder for ${PROJECT_NAME}" + ) + + add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}Fixture) + + set_target_properties(${PROJECT_NAME}Fixture PROPERTIES FOLDER UtilityTargets/Tests/Bigfoot/${ParentFolder}) + endfunction() \ No newline at end of file diff --git a/CMake/Utils.cmake b/CMake/Utils.cmake index 3f0692b..9841ed8 100644 --- a/CMake/Utils.cmake +++ b/CMake/Utils.cmake @@ -1,14 +1,14 @@ -function(bigfoot_create_logger PackageName) - set(LOGGER_FILENAME ${PackageName}Logger) - string(TOUPPER ${PackageName}_Logger LOGGER_NAME) +function(bigfoot_create_logger) + set(LOGGER_FILENAME ${PROJECT_NAME}Logger) + string(TOUPPER ${PROJECT_NAME}_Logger LOGGER_NAME) string(TOUPPER ${LOGGER_FILENAME} LOGGER_FILENAME_UPPER) - configure_file( ${CMAKE_SOURCE_DIR}/Bigfoot/Sources/Utils/Include/Utils/TargetLogger.generated.hpp.in - ${CMAKE_CURRENT_SOURCE_DIR}/Include/${PackageName}/${LOGGER_FILENAME}.generated.hpp + configure_file( ${CMAKE_SOURCE_DIR}/Bigfoot/Sources/System/Include/System/Log/TargetLogger_generated.hpp.in + ${CMAKE_CURRENT_SOURCE_DIR}/Include/${PROJECT_NAME}/${LOGGER_FILENAME}_generated.hpp @ONLY) endfunction() -function(bigfoot_create_bigfile PackageName ParentFolder) - set(OUTPUT_PATH_BIGFILE "${CMAKE_CURRENT_BINARY_DIR}/${PackageName}-bigfile.db") +function(bigfoot_create_bigfile ParentFolder) + set(OUTPUT_PATH_BIGFILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${PROJECT_NAME}-bigfile.db") get_filename_component(OUTPUT_PATH_BIGFILE_ABSOLUTE ${OUTPUT_PATH_BIGFILE} ABSOLUTE) get_filename_component(OUTPUT_PATH_BIGFILE_DIRECTORY ${OUTPUT_PATH_BIGFILE_ABSOLUTE} DIRECTORY) @@ -16,125 +16,130 @@ function(bigfoot_create_bigfile PackageName ParentFolder) OUTPUT ${OUTPUT_PATH_BIGFILE_ABSOLUTE}.bftimestamp ${OUTPUT_PATH_BIGFILE_ABSOLUTE} DEPENDS ${CMAKE_SOURCE_DIR}/Bigfoot/Sources/Engine/BigFile/BigFileSchema.sql COMMAND ${CMAKE_COMMAND} -E make_directory ${OUTPUT_PATH_BIGFILE_DIRECTORY} - COMMAND sqlite3 ${OUTPUT_PATH_BIGFILE_ABSOLUTE} < ${CMAKE_SOURCE_DIR}/Bigfoot/Sources/Engine/BigFile/BigFileSchema.sql + COMMAND ${SQLITE3_EXECUTABLE} ${OUTPUT_PATH_BIGFILE_ABSOLUTE} < ${CMAKE_SOURCE_DIR}/Bigfoot/Sources/Engine/BigFile/BigFileSchema.sql COMMAND ${CMAKE_COMMAND} -E touch ${OUTPUT_PATH_BIGFILE_ABSOLUTE}.bftimestamp COMMENT "Creating Bigfile ${OUTPUT_PATH_BIGFILE_ABSOLUTE}" ) list(APPEND BIGFILE_SOURCES ${OUTPUT_PATH_BIGFILE_ABSOLUTE}.bftimestamp) - add_custom_target(${PackageName}BigFile ALL DEPENDS ${BIGFILE_SOURCES}) - set_target_properties(${PackageName}BigFile PROPERTIES FOLDER UtilityTargets/${ParentFolder}) + add_custom_target(${PROJECT_NAME}BigFile ALL DEPENDS ${BIGFILE_SOURCES}) + set_target_properties(${PROJECT_NAME}BigFile PROPERTIES FOLDER UtilityTargets/${ParentFolder}) + add_dependencies(${PROJECT_NAME}BigFile ${PROJECT_NAME}) - target_sources(${PackageName}BigFile PRIVATE ${BIGFILE_SOURCES}) + target_sources(${PROJECT_NAME}BigFile PRIVATE ${BIGFILE_SOURCES}) - string(TOUPPER ${PackageName} BIGFILE_NAME) - set(BIGFILE_LOCATION ${OUTPUT_PATH_BIGFILE_ABSOLUTE}) - configure_file( ${CMAKE_SOURCE_DIR}/Bigfoot/Sources/Engine/Include/Engine/BigFile/BigFileInfo.generated.hpp.in - ${CMAKE_CURRENT_SOURCE_DIR}/Include/${PackageName}/BigFileInfo.generated.hpp + string(TOUPPER ${PROJECT_NAME} BIGFILE_NAME) + set(BIGFILE_LOCATION "./${PROJECT_NAME}-bigfile.db") + configure_file( ${CMAKE_SOURCE_DIR}/Bigfoot/Sources/Engine/Include/Engine/BigFile/BigFileInfo_generated.hpp.in + ${CMAKE_CURRENT_SOURCE_DIR}/Include/${PROJECT_NAME}/BigFileInfo_generated.hpp @ONLY) endfunction() -function(bigfoot_compile_flatbuffers Source IncludeFolders) - file(GLOB_RECURSE SOURCES ${Source}/*.fbs) +function(bigfoot_compile_flatbuffers BigfootDependencies) + set(IncludeFolders "") - foreach(SOURCE_FILE ${SOURCES}) + get_target_property(CurrentTargetDependencyInclude ${PROJECT_NAME} INCLUDE_DIRECTORIES) + if(CurrentTargetDependencyInclude) + list(APPEND IncludeFolders ${CurrentTargetDependencyInclude}) + endif() + + foreach(Dependency IN LISTS BigfootDependencies) + get_target_property(DependencyInclude ${Dependency} INCLUDE_DIRECTORIES) + if(DependencyInclude) + list(APPEND IncludeFolders ${DependencyInclude}) + endif() + endforeach() + + set(IncludeFlags "") + foreach(folder IN LISTS IncludeFolders) + list(APPEND IncludeFlags -I "${folder}") + endforeach() + + file(GLOB_RECURSE SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/Include/*.fbs") + foreach(SOURCE_FILE IN LISTS SOURCES) get_filename_component(SOURCE_DIRECTORY ${SOURCE_FILE} DIRECTORY) set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${SOURCE_FILE}) execute_process( COMMAND ${FLATBUFFERS_FLATC_EXECUTABLE} - --cpp - -I ${IncludeFolders} - --keep-prefix - --scoped-enums - --gen-name-strings - --gen-object-api - --gen-compare - --force-empty - --no-cpp-direct-copy - --cpp-str-flex-ctor - --cpp-std c++17 - --reflect-names - -o "${SOURCE_DIRECTORY}" - "${SOURCE_FILE}" + --cpp + ${IncludeFlags} + --keep-prefix + --filename-ext "hpp" + --reflect-types + --cpp-std c++17 + --reflect-names + --gen-name-strings + --gen-object-api + --cpp-str-flex-ctor + --no-cpp-direct-copy + --force-empty + --cpp-ptr-type "eastl::unique_ptr" + --cpp-str-type "eastl::string" + --cpp-include "EASTL/unique_ptr.h" + --cpp-include "EASTL/string.h" + -o "${SOURCE_DIRECTORY}" + "${SOURCE_FILE}" ) endforeach() endfunction() -function(bigfoot_setup_dependencies Target ParentFolder) +function(bigfoot_setup_dependencies ParentFolder) set(CONAN_DEPLOYER_DIR "${CMAKE_SOURCE_DIR}/build/full_deploy/host") if(EXISTS ${CONAN_DEPLOYER_DIR}) if(CMAKE_SYSTEM_NAME STREQUAL "Windows") - file(GLOB_RECURSE all_binaries ${CONAN_DEPLOYER_DIR}/*mimalloc*.dll) + file(GLOB_RECURSE SHARED_BINARIES ${CONAN_DEPLOYER_DIR}/*mimalloc*.dll) elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") - file(GLOB_RECURSE all_binaries ${CONAN_DEPLOYER_DIR}/*mimalloc*.so*) + file(GLOB_RECURSE SHARED_BINARIES ${CONAN_DEPLOYER_DIR}/*mimalloc*.so*) endif() - if(NOT all_binaries STREQUAL "") - if(${is_multi_config}) - foreach(CONFIG ${CMAKE_CONFIGURATION_TYPES}) - if(CMAKE_SYSTEM_NAME STREQUAL "Windows") - foreach(file ${all_binaries}) - if(file MATCHES "/${CONFIG}/") - list(APPEND shared_binaries_${CONFIG} ${file}) - endif() - endforeach() - elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") - foreach(file ${all_binaries}) - if(file MATCHES "/${CONFIG}/") - list(APPEND shared_binaries_${CONFIG} ${file}) - endif() - endforeach() + if(${IS_MULTI_CONFIG}) + foreach(CONFIG ${CMAKE_CONFIGURATION_TYPES}) + foreach(file ${SHARED_BINARIES}) + if(file MATCHES "/${CONFIG}/") + list(APPEND SHARED_BINARIES_${CONFIG} ${file}) endif() endforeach() + endforeach() - add_custom_target(${Target}CopySharedBinaries - ALL DEPENDS all_binaries - COMMAND ${CMAKE_COMMAND} -E make_directory $ - COMMAND ${CMAKE_COMMAND} -E $,copy_if_different,true> ${shared_binaries_Debug} $ - COMMAND ${CMAKE_COMMAND} -E $,copy_if_different,true> ${shared_binaries_Release} $ - COMMAND ${CMAKE_COMMAND} -E $,copy_if_different,true> ${shared_binaries_RelWithDebInfo} $ - COMMENT "Copy shared binaries" - ) - add_dependencies(${Target} ${Target}CopySharedBinaries) - set_target_properties(${Target}CopySharedBinaries PROPERTIES FOLDER UtilityTargets/${ParentFolder}) + add_custom_target(${PROJECT_NAME}CopySharedBinaries + ALL DEPENDS SHARED_BINARIES + COMMAND ${CMAKE_COMMAND} -E make_directory $ + COMMAND ${CMAKE_COMMAND} -E $,copy_if_different,true> ${SHARED_BINARIES_Debug} $ + COMMAND ${CMAKE_COMMAND} -E $,copy_if_different,true> ${SHARED_BINARIES_Release} $ + COMMAND ${CMAKE_COMMAND} -E $,copy_if_different,true> ${SHARED_BINARIES_RelWithDebInfo} $ + COMMENT "Copy shared binaries for ${PROJECT_NAME}" + ) + add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}CopySharedBinaries) + set_target_properties(${PROJECT_NAME}CopySharedBinaries PROPERTIES FOLDER UtilityTargets/${ParentFolder}) - else() - if(CMAKE_SYSTEM_NAME STREQUAL "Windows") - foreach(file ${all_binaries}) - if(file MATCHES "/${CMAKE_BUILD_TYPE}/") - list(APPEND shared_binaries_${CMAKE_BUILD_TYPE} ${file}) - endif() - endforeach() - elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") - foreach(file ${all_binaries}) - if(file MATCHES "/${CMAKE_BUILD_TYPE}/") - list(APPEND shared_binaries_${CMAKE_BUILD_TYPE} ${file}) - endif() - endforeach() + else() + foreach(file ${SHARED_BINARIES}) + if(file MATCHES "/${CMAKE_BUILD_TYPE}/") + list(APPEND SHARED_BINARIES_${CMAKE_BUILD_TYPE} ${file}) endif() + endforeach() - add_custom_target(${Target}CopySharedBinaries ALL - DEPENDS ${shared_binaries_${CMAKE_BUILD_TYPE}} - COMMAND ${CMAKE_COMMAND} -E make_directory $ - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${shared_binaries_${CMAKE_BUILD_TYPE}} $ - COMMENT "Copy shared binaries" - ) - add_dependencies(${Target} ${Target}CopySharedBinaries) - set_target_properties(${Target}CopySharedBinaries PROPERTIES FOLDER UtilityTargets/${ParentFolder}) - endif() + add_custom_target(${PROJECT_NAME}CopySharedBinaries ALL + DEPENDS ${SHARED_BINARIES_${CMAKE_BUILD_TYPE}} + COMMAND ${CMAKE_COMMAND} -E make_directory $ + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SHARED_BINARIES_${CMAKE_BUILD_TYPE}} $ + COMMENT "Copy shared binaries for ${PROJECT_NAME}" + ) + add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}CopySharedBinaries) + set_target_properties(${PROJECT_NAME}CopySharedBinaries PROPERTIES FOLDER UtilityTargets/${ParentFolder}) endif() endif() if(CMAKE_SYSTEM_NAME STREQUAL "Windows") - add_custom_command( - TARGET ${Target} - POST_BUILD - COMMAND ${CMAKE_SOURCE_DIR}/Vendor/Tools/Mimalloc2.2.4/minject.exe -i -f $ - COMMENT "Patching ${Target} to ensure mimalloc dynamic override" + add_custom_target(${PROJECT_NAME}PatchMinject ALL + COMMAND ${MINJECT_EXECUTABLE} -i -f $ + COMMENT "Patching ${PROJECT_NAME} to ensure mimalloc dynamic override" ) + add_dependencies(${PROJECT_NAME}PatchMinject ${PROJECT_NAME}) + set_target_properties(${PROJECT_NAME}PatchMinject PROPERTIES FOLDER "UtilityTargets/${ParentFolder}") endif() endfunction() \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 9b41ced..0fd09f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,7 @@ cmake_minimum_required(VERSION 3.24) +string(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + project(Bigfoot VERSION 0.1.0 DESCRIPTION "The Bigfoot engine" LANGUAGES CXX) @@ -9,17 +11,14 @@ set(CMAKE_CXX_STANDARD_REQUIRED True) set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) -get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) set(CMAKE_CONFIGURATION_TYPES "Release;RelWithDebInfo;Debug" CACHE STRING "" FORCE) option(BUILD_TESTS OFF) -option(SAMPLE_APP OFF) option(TRACY ON) -option(UNITY_BUILD ON) option(BUILD_TOOLS ON) option(VULKAN ON) option(BUILD_BENCHMARKS OFF) -option(RENDER_DOC ON) set(AUTO_GENERATED_COMMENT "// AUTO-GENERATED DO NOT TOUCH") @@ -27,12 +26,9 @@ include(${CMAKE_SOURCE_DIR}/CMake/FindDependencies.cmake) include(${CMAKE_SOURCE_DIR}/CMake/Utils.cmake) include(${CMAKE_SOURCE_DIR}/CMake/Package.cmake) -find_program(CCACHE_PROGRAM ccache) -if(CCACHE_PROGRAM) - set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}") -endif() - find_program(FLATBUFFERS_FLATC_EXECUTABLE NAMES flatc) +find_program(SQLITE3_EXECUTABLE NAMES sqlite3) +find_program(MINJECT_EXECUTABLE NAMES minject) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_OPTIMIZE_DEPENDENCIES 1) @@ -45,13 +41,6 @@ add_compile_definitions( $<$:BIGFOOT_OPTIMIZED> $<$:BIGFOOT_NOT_OPTIMIZED>) -if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - add_compile_definitions( - $<$:_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE> - $<$:_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG>) -endif() -#TODO: MSVC equivalent - if(BUILD_TESTS) enable_testing() endif() diff --git a/README.md b/README.md index afacb7c..ec83174 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,3 @@ - -
- -[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=bigfootdev_bigfoot&metric=sqale_rating&token=a71406a36f0a21eca9d5ef489c7b2e6a362c2627)](https://sonarcloud.io/summary/new_code?id=bigfootdev_bigfoot) -[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=bigfootdev_bigfoot&metric=reliability_rating&token=a71406a36f0a21eca9d5ef489c7b2e6a362c2627)](https://sonarcloud.io/summary/new_code?id=bigfootdev_bigfoot) -[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=bigfootdev_bigfoot&metric=security_rating&token=a71406a36f0a21eca9d5ef489c7b2e6a362c2627)](https://sonarcloud.io/summary/new_code?id=bigfootdev_bigfoot) -[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=bigfootdev_bigfoot&metric=coverage&token=a71406a36f0a21eca9d5ef489c7b2e6a362c2627)](https://sonarcloud.io/summary/new_code?id=bigfootdev_bigfoot) -[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=bigfootdev_bigfoot&metric=bugs&token=a71406a36f0a21eca9d5ef489c7b2e6a362c2627)](https://sonarcloud.io/summary/new_code?id=bigfootdev_bigfoot) -[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=bigfootdev_bigfoot&metric=code_smells&token=a71406a36f0a21eca9d5ef489c7b2e6a362c2627)](https://sonarcloud.io/summary/new_code?id=bigfootdev_bigfoot) -[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=bigfootdev_bigfoot&metric=vulnerabilities&token=a71406a36f0a21eca9d5ef489c7b2e6a362c2627)](https://sonarcloud.io/summary/new_code?id=bigfootdev_bigfoot) -[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=bigfootdev_bigfoot&metric=sqale_index&token=a71406a36f0a21eca9d5ef489c7b2e6a362c2627)](https://sonarcloud.io/summary/new_code?id=bigfootdev_bigfoot) -[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=bigfootdev_bigfoot&metric=ncloc&token=a71406a36f0a21eca9d5ef489c7b2e6a362c2627)](https://sonarcloud.io/summary/new_code?id=bigfootdev_bigfoot) -[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=bigfootdev_bigfoot&metric=duplicated_lines_density&token=a71406a36f0a21eca9d5ef489c7b2e6a362c2627)](https://sonarcloud.io/summary/new_code?id=bigfootdev_bigfoot) - -[![Quality gate](https://sonarcloud.io/api/project_badges/quality_gate?project=bigfootdev_bigfoot&token=a71406a36f0a21eca9d5ef489c7b2e6a362c2627)](https://sonarcloud.io/summary/new_code?id=bigfootdev_bigfoot) - -
- # Bigfoot A multiplatform 3D game engine diff --git a/Vendor/Tools/Mimalloc2.2.4/minject.exe b/Vendor/Tools/Mimalloc2.2.4/minject.exe deleted file mode 100644 index 91c7951292186f0147fa29f088511e5edb4a9f96..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 24064 zcmeHv3w%>mw)alcl+sr!G)xhYQw&msmeQhAXe$X#@C4IRON*dlThg@6m?kj~XptF< zX_a`4!*#q~$IEq)an$R)7_WnXI<}NYc_|McAU@DxG+5E9BOpHV{ntJxZK#fO=YDg) z@BZ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9!QJiC)&;H@oqFQAOIKCD5q@&ZE%lGw<=@kNd;Kb@ z@Pk!E^N;I)o(3{AaWutEv6gzkU*KMg^d>+JVhi^noeAj1y#Z+t;7$b}A8(*I1dga| z6KDv|!QF>+d~AVY4h4uIoCKcWHMr?-e#XZVD8?WnUXTqu!Ajh-hz2kgQy?hn@Qo(X z09N9zCmO)*V<98b2LT%{X6$aHJ%CGd&=;iR&;0T60E!EIpl9qQ&=54^Y#u?HU^VV@ zR2MK72OteTpZAcTm68Bo936|p~dV+LzCw%-F zp3e8X;Z2?bp5QO0;hRXLHvv9__~!|vDGutzd7b);Z=e{ylVV>2Pw?NA^aeosd$x&7 zWSEaM(NHAIp`@LFk1FZM0gDP{p0fb=<2Io#!2tzNaBPuGGahiUl3oJn#!dV^fa7N& zhKssYfH&hN{5rs+S3oDgp8%YBrHnTL{tWk8;5PuiuA~Xl_q&8A_|9yMDbo0cjBUsL zIPn3b_{1ip2~rHA6lsFvaW^9UkLxdKK*eLJ*$81=NFjfBUhpmWk%^dtAf`Cz4~H+_ zz?aT#YsKeBcCQb+?6N5{^9!cn9lp&?FHOs))Yi<;E1n|w{Mbr0;PVB0*_3v>Z_3=O z(o;(DNt(TNIo_Isfy-AmCE#_<@!>O|)&?J5v?^~u@zq1?oCaTO{)(AX==%gmlilZE z9N!vP2|}sg8}Rupc>k$zoAg(>6;0yxP?NuqcKF+sJTPASEdjJ*Z>;hcZsUfHn>O}sJh&0aD!DB8 dVZ+1X!v`OZJUsC5xrf=tWGef|^}j*`{|A`ww_E@K diff --git a/conanfile.py b/conanfile.py index fb9313b..5e7c205 100644 --- a/conanfile.py +++ b/conanfile.py @@ -7,7 +7,7 @@ required_conan_version = ">=1.33.0" class Bigfoot(ConanFile): name = "bigfoot" - homepage = "https://gitlab.com/bigfootdev/bigfoot" + homepage = "https://git.romainboullard.com/BigfootDev/Bigfoot" description = "Bigfoot is a 3D game engine written in C++" topics = ("game engine", "3d") license = "MIT" @@ -18,28 +18,20 @@ class Bigfoot(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], - "unity_build": [True, False], "build_tests": [True, False], - "sample_app": [True, False], "tracy": [True, False], "build_tools": [True, False], "vulkan": [True, False], "build_benchmarks": [True, False], - "build_benchmarks_lto": [True, False], - "render_doc": [True, False] } default_options = { "shared": False, "fPIC": True, - "unity_build": True, "build_tests": False, - "sample_app": False, "tracy": False, "build_tools": True, "vulkan": True, "build_benchmarks": False, - "build_benchmarks_lto": True, - "render_doc": False } generators = "CMakeDeps" @@ -67,52 +59,49 @@ class Bigfoot(ConanFile): if(self.options.build_benchmarks): self.options["benchmark"].enable_exceptions = False - if(self.options.build_benchmarks_lto): - self.options["benchmark"].enable_lto = True + self.options["benchmark"].enable_lto = True def requirements(self): - self.requires("eastl/3.27.00", transitive_headers=True) - self.requires("unordered_dense/4.7.0", transitive_headers=True) - self.requires("mimalloc/2.2.4", transitive_headers=True) - self.requires("magic_enum/0.9.7", transitive_headers=True) + self.requires("eastl/3.27.01@bigfootdev/main", transitive_headers=True) + self.requires("unordered_dense/4.8.1@bigfootdev/main", transitive_headers=True) + self.requires("mimalloc/3.1.5@bigfootdev/main", transitive_headers=True) self.requires("stduuid/1.2.3", transitive_headers=True) - self.requires("sqlite3/3.50.4", transitive_headers=True) - self.requires("cli11/2.5.0") - self.requires("xxhash/0.8.3", transitive_headers=True) + self.requires("sqlite3/3.51.0@bigfootdev/main", transitive_headers=True) + self.requires("cli11/2.6.0") + self.requires("rapidhash/3.0@bigfootdev/main", transitive_headers=True) self.requires("effolkronium-random/1.5.0", transitive_headers=True) - self.requires("zeus_expected/1.3.0", transitive_headers=True) - self.requires("flatbuffers/25.9.23", transitive_headers=True) + self.requires("flatbuffers/25.12.19@bigfootdev/main", transitive_headers=True) if(self.settings.build_type == "RelWithDebInfo" or self.settings.build_type == "Debug"): - self.requires("quill/10.0.1", transitive_headers=True) + self.requires("quill/11.0.2", transitive_headers=True) self.requires("cpptrace/1.0.4", transitive_headers=True) if(self.options.tracy): self.requires("tracy/0.12.2", transitive_headers=True) self.requires("glm/1.0.1", transitive_headers=True) - self.requires("lodepng/cci.20250727", transitive_headers=True) - self.requires("imgui/1.92.4-docking", transitive_headers=True) + self.requires("lodepng/cci.20250727@bigfootdev/main", transitive_headers=True) + self.requires("imgui/1.92.5-docking", transitive_headers=True) if(self.options.vulkan): self.requires("vulkan-headers/1.4.313.0") if(self.settings.build_type == "RelWithDebInfo" or self.settings.build_type == "Debug"): - self.requires("vulkan-validationlayers/1.4.313.0") - self.requires("vulkan-memory-allocator/3.3.0") + self.requires("vulkan-validationlayers/1.4.313.0@bigfootdev/main") + self.requires("vulkan-memory-allocator/3.3.0@bigfootdev/main") - if(self.options.sample_app or self.options.build_tests or self.options.build_benchmarks): + if(self.options.build_tests or self.options.build_benchmarks): self.requires("glfw/3.4") if(self.options.build_tests): self.test_requires("gtest/1.17.0") - self.test_requires("pixelmatch-cpp17/1.0.3") + self.test_requires("pixelmatch-cpp17/1.0.3@bigfootdev/main") if(self.options.build_tools): self.requires("spirv-cross/1.4.313.0") - self.requires("shaderc/2025.3") + self.requires("shaderc/2025.3@bigfootdev/main") self.requires("stb/cci.20240531", override=True) - self.requires("assimp/5.4.3") - self.requires("meshoptimizer/0.25") + self.requires("assimp/6.0.2") + self.requires("meshoptimizer/1.0@bigfootdev/main") self.requires("libsquish/1.15") if(self.options.build_benchmarks): @@ -121,14 +110,11 @@ class Bigfoot(ConanFile): def generate(self): tc = CMakeToolchain(self) - tc.variables["UNITY_BUILD"] = self.options.unity_build tc.variables["BUILD_TESTS"] = self.options.build_tests tc.variables["TRACY"] = self.options.tracy tc.variables["BUILD_TOOLS"] = self.options.build_tools tc.variables["VULKAN"] = self.options.vulkan tc.variables["BUILD_BENCHMARKS"] = self.options.build_benchmarks - tc.variables["RENDER_DOC"] = self.options.render_doc - tc.variables["SAMPLE_APP"] = self.options.sample_app tc.generate() diff --git a/format.bat b/format.bat index 231ce1a..54d904f 100644 --- a/format.bat +++ b/format.bat @@ -1,30 +1,71 @@ @echo off -REM Variable that will hold the name of the clang-format command +SETLOCAL ENABLEDELAYEDEXPANSION + +REM ========================= +REM Variables +REM ========================= SET FMT=clang-format +SET MODE= +SET EXIT_CODE=0 -REM Function to format files -:format -for /r %%f in (*.h *.m *.mm *.c *.cpp) do ( - echo %%~nxf | findstr /i "_generated.h$" >nul - if errorlevel 1 ( - echo format %%f - %FMT% -i "%%f" +REM ========================= +REM Parse arguments +REM ========================= +:parse_args +IF "%~1"=="" GOTO end_parse_args +IF "%~1"=="--check" ( + SET MODE=check +) ELSE IF "%~1"=="--fix" ( + SET MODE=fix +) ELSE ( + REM Accumulate directories + SET DIRS=!DIRS! "%~1" +) +SHIFT +GOTO parse_args +:end_parse_args + +IF "%MODE%"=="" ( + ECHO Usage: %~nx0 --check|--fix [ ...] + EXIT /B 1 +) + +IF "%DIRS%"=="" ( + ECHO Please provide at least one directory. + EXIT /B 1 +) + +REM ========================= +REM Iterate over directories +REM ========================= +FOR %%D IN (%DIRS%) DO ( + IF NOT EXIST "%%~D" ( + ECHO %%~D is not a valid directory. + SET EXIT_CODE=1 + GOTO :continue_dirs ) -) -echo ~~~ %1 Done ~~~ -exit /b -REM Check if argument is provided -if "%1"=="" ( - echo Please provide a directory as an argument. - exit /b + REM Recursively find source files + FOR /R "%%~D" %%F IN (*.h *.hpp *.c *.cpp *.m *.mm) DO ( + SET FILE=%%F + REM Skip *_generated* files + ECHO !FILE! | FINDSTR /I "_generated" >nul + IF ERRORLEVEL 1 ( + IF "%MODE%"=="fix" ( + ECHO Formatting !FILE! + %FMT% -i "!FILE!" + ) ELSE ( + ECHO Checking !FILE! + %FMT% --dry-run --Werror "!FILE!" 2>nul + IF ERRORLEVEL 1 ( + REM clang-format will already print diagnostics + SET EXIT_CODE=1 + ) + ) + ) + ) + + :continue_dirs ) -REM Check if directory exists -if not exist "%1" ( - echo %1 is not a valid directory. - exit /b -) - -cd %1 -call :format +EXIT /B %EXIT_CODE% diff --git a/format.sh b/format.sh index 69f19d1..eb8f665 100644 --- a/format.sh +++ b/format.sh @@ -1,31 +1,68 @@ #!/bin/bash +set -euo pipefail -# Variable that will hold the name of the clang-format command FMT="clang-format" +MODE="" +DIRS=() +EXIT_CODE=0 -# Function to format files -format() { - for f in $(find "$1" \( -name '*.h' -or -name '*.m' -or -name '*.mm' -or -name '*.c' -or -name '*.cpp' \)); do - # Skip *_generated.h files - if [[ "$f" == *_generated.h ]]; then - continue +# ========================= +# Parse arguments +# ========================= +for arg in "$@"; do + case "$arg" in + --check) + MODE="check" + ;; + --fix) + MODE="fix" + ;; + *) + DIRS+=("$arg") + ;; + esac +done + +# Ensure mode is set +if [[ -z "$MODE" ]]; then + echo "Usage: $0 --check|--fix [ ...]" + exit 1 +fi + +# Ensure at least one directory +if [[ ${#DIRS[@]} -eq 0 ]]; then + echo "Please provide at least one directory." + exit 1 +fi + +# ========================= +# Process directories +# ========================= +for DIR in "${DIRS[@]}"; do + if [[ ! -d "$DIR" ]]; then + echo "$DIR is not a valid directory." + EXIT_CODE=1 + continue + fi + + # Find all source files safely (null-separated) + while IFS= read -r -d '' FILE; do + [[ "$FILE" == *_generated* ]] && continue + + if [[ "$MODE" == "fix" ]]; then + echo "Formatting $FILE" + "$FMT" -i "$FILE" + else + echo "Checking $FILE" + # Check mode: clang-format diagnostic only + if ! "$FMT" --dry-run --Werror "$FILE"; then + # clang-format prints: file:line:col: error ... + EXIT_CODE=1 + fi fi - echo "format ${f}" - ${FMT} -i "${f}" - done - echo "~~~ $1 Done ~~~" -} + done < <( + find "$DIR" \( -name '*.h' -o -name '*.hpp' -o -name '*.c' -o -name '*.cpp' -o -name '*.m' -o -name '*.mm' \) -print0 + ) +done -# Check if argument is provided -if [ -z "$1" ]; then - echo "Please provide a directory as an argument." - exit 1 -fi - -# Check if directory exists -if [ ! -d "$1" ]; then - echo "$1 is not a valid directory." - exit 1 -fi - -format "$1" +exit $EXIT_CODE diff --git a/generate_dependencies.bat b/generate_dependencies.bat index 77be6f8..f7de8c6 100644 --- a/generate_dependencies.bat +++ b/generate_dependencies.bat @@ -20,14 +20,14 @@ if "%~1"=="force" ( ) REM Add the remote -conan remote add bigfootpackages https://conan.romainboullard.com/artifactory/api/conan/bigfootpackages +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/*:unity_build=False -o bigfoot/*:build_tests=True -o bigfoot/*:sample_app=True -o bigfoot/*:tracy=True -o bigfoot/*:build_tools=True -o bigfoot/*:vulkan=True -o bigfoot/*:build_benchmarks=True -o bigfoot/*:build_benchmarks_lto=True -o bigfoot/*:render_doc=True -conan install . --deployer=full_deploy --remote=bigfootpackages -pr:h=msvc -pr:b=msvc %build_option% -of build -s build_type=RelWithDebInfo -o bigfoot/*:unity_build=False -o bigfoot/*:build_tests=True -o bigfoot/*:sample_app=True -o bigfoot/*:tracy=True -o bigfoot/*:build_tools=True -o bigfoot/*:vulkan=True -o bigfoot/*:build_benchmarks=True -o bigfoot/*:build_benchmarks_lto=True -o bigfoot/*:render_doc=True -conan install . --deployer=full_deploy --remote=bigfootpackages -pr:h=msvc -pr:b=msvc %build_option% -of build -s build_type=Debug -o bigfoot/*:unity_build=False -o bigfoot/*:build_tests=True -o bigfoot/*:sample_app=True -o bigfoot/*:tracy=True -o bigfoot/*:build_tools=True -o bigfoot/*:vulkan=True -o bigfoot/*:build_benchmarks=True -o bigfoot/*:build_benchmarks_lto=True -o bigfoot/*:render_doc=True +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 endlocal diff --git a/generate_dependencies.sh b/generate_dependencies.sh index d0c6d3f..6d90476 100644 --- a/generate_dependencies.sh +++ b/generate_dependencies.sh @@ -7,20 +7,20 @@ if [ -z "$1" ]; then fi # Add the remote -conan remote add bigfootpackages https://conan.romainboullard.com/artifactory/api/conan/bigfootpackages +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 --deployer-folder=build --remote=bigfootpackages -pr:h=clang -pr:b=clang --build='*' -of build -s build_type=Release -o bigfoot/*:unity_build=True -o bigfoot/*:build_tests=True -o bigfoot/*:sample_app=True -o bigfoot/*:tracy=True -o bigfoot/*:build_tools=True -o bigfoot/*:vulkan=True -o bigfoot/*:build_benchmarks=True -o bigfoot/*:build_benchmarks_lto=True -o bigfoot/*:render_doc=True - conan install . --deployer=full_deploy --deployer-folder=build --remote=bigfootpackages -pr:h=clang -pr:b=clang --build='*' -of build -s build_type=RelWithDebInfo -o bigfoot/*:unity_build=True -o bigfoot/*:build_tests=True -o bigfoot/*:sample_app=True -o bigfoot/*:tracy=True -o bigfoot/*:build_tools=True -o bigfoot/*:vulkan=True -o bigfoot/*:build_benchmarks=True -o bigfoot/*:build_benchmarks_lto=True -o bigfoot/*:render_doc=True - conan install . --deployer=full_deploy --deployer-folder=build --remote=bigfootpackages -pr:h=clang -pr:b=clang --build='*' -of build -s build_type=Debug -o bigfoot/*:unity_build=True -o bigfoot/*:build_tests=True -o bigfoot/*:sample_app=True -o bigfoot/*:tracy=True -o bigfoot/*:build_tools=True -o bigfoot/*:vulkan=True -o bigfoot/*:build_benchmarks=True -o bigfoot/*:build_benchmarks_lto=True -o bigfoot/*:render_doc=True + 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 elif [ "$1" == "missing" ]; then - conan install . --deployer=full_deploy --deployer-folder=build --remote=bigfootpackages -pr:h=clang -pr:b=clang --build=missing -of build -s build_type=Release -o bigfoot/*:unity_build=True -o bigfoot/*:build_tests=True -o bigfoot/*:sample_app=True -o bigfoot/*:tracy=True -o bigfoot/*:build_tools=True -o bigfoot/*:vulkan=True -o bigfoot/*:build_benchmarks=True -o bigfoot/*:build_benchmarks_lto=True -o bigfoot/*:render_doc=True - conan install . --deployer=full_deploy --deployer-folder=build --remote=bigfootpackages -pr:h=clang -pr:b=clang --build=missing -of build -s build_type=RelWithDebInfo -o bigfoot/*:unity_build=True -o bigfoot/*:build_tests=True -o bigfoot/*:sample_app=True -o bigfoot/*:tracy=True -o bigfoot/*:build_tools=True -o bigfoot/*:vulkan=True -o bigfoot/*:build_benchmarks=True -o bigfoot/*:build_benchmarks_lto=True -o bigfoot/*:render_doc=True - conan install . --deployer=full_deploy --deployer-folder=build --remote=bigfootpackages -pr:h=clang -pr:b=clang --build=missing -of build -s build_type=Debug -o bigfoot/*:unity_build=True -o bigfoot/*:build_tests=True -o bigfoot/*:sample_app=True -o bigfoot/*:tracy=True -o bigfoot/*:build_tools=True -o bigfoot/*:vulkan=True -o bigfoot/*:build_benchmarks=True -o bigfoot/*:build_benchmarks_lto=True -o bigfoot/*:render_doc=True + 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 else echo "Invalid argument: $1" echo "Usage: $0 [force|missing]" diff --git a/sonar-project.properties b/sonar-project.properties deleted file mode 100644 index ed388ec..0000000 --- a/sonar-project.properties +++ /dev/null @@ -1,10 +0,0 @@ -sonar.projectKey=bigfootdev_bigfoot -sonar.organization=bigfootdev -sonar.projectName=Bigfoot -sonar.projectVersion=0.1.0 -sonar.sources=Bigfoot/Sources -sonar.tests=Bigfoot/Tests -sonar.sourceEncoding=UTF-8 - -sonar.exclusions= \ - Bigfoot/Sources/Engine/BigFile/BigFileSchema.sql diff --git a/sonarqube.sh b/sonarqube.sh deleted file mode 100644 index 7ba2a21..0000000 --- a/sonarqube.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -mkdir SonarqubeResult - -mkdir SonarqubeResult/UnitTests -mkdir SonarqubeResult/UnitTests/Merged -mkdir SonarqubeResult/UnitTests/Merged/CPPUnit -./build/Debug/Bigfoot/Tests/System/SystemTests --gtest_output="xml:SonarqubeResult/UnitTests/SystemTests.xml" -./build/Debug/Bigfoot/Tests/Utils/UtilsTests --gtest_output="xml:SonarqubeResult/UnitTests/UtilsTests.xml" -./build/Debug/Bigfoot/Tests/Engine/EngineTests --gtest_output="xml:SonarqubeResult/UnitTests/EngineTests.xml" -python3 merge_junit_results.py SonarqubeResult/UnitTests SonarqubeResult/UnitTests/Merged/tests.xml -python3 convert_junit_to_cppunit.py SonarqubeResult/UnitTests/Merged/tests.xml SonarqubeResult/UnitTests/Merged/CPPUnit/cppunit.xml - -mkdir SonarqubeResult/CoverageReport -gcovr --filter Bigfoot/Sources/ --gcov-ignore-parse-errors negative_hits.warn --exclude-lines-by-pattern '.*ASSERT*.' --sonarqube SonarqubeResult/CoverageReport/coverage.xml --html-nested SonarqubeResult/CoverageReport/coverage.html