From cd9e2678d391bbb5fad6cbc051d602199b356d7e Mon Sep 17 00:00:00 2001 From: Sacha Bellier Date: Sat, 1 Jun 2024 23:15:58 +0200 Subject: [PATCH 1/4] feat: latest bazel modules; copts handled using select on toolchain --- .bazelrc | 8 -------- .buildkite/linux_amd64.yml | 8 ++++---- .buildkite/windows_amd64.yml | 4 ++-- .github/workflows/LittleECS.yml | 12 ++++++------ .gitignore | 10 +++++----- BUILD | 16 ++++++++++++++-- Docs/Workflow.md | 7 +------ Examples/.bazelrc | 7 ------- Examples/README.md | 14 ++------------ Examples/Workflow/BUILD | 4 ++++ Examples/Workflow/main.cpp | 5 +++-- MODULE.bazel | 3 ++- WORKSPACE | 12 ++++++------ 13 files changed, 49 insertions(+), 61 deletions(-) diff --git a/.bazelrc b/.bazelrc index 9feacb2..4d9baff 100644 --- a/.bazelrc +++ b/.bazelrc @@ -6,13 +6,6 @@ common --show_timestamps common --verbose_failures test --test_output=errors -# Opts -common:linux --config=default_compiler_opts -common:msvc --config=microsoft_compiler_opts - -common:default_compiler_opts --copt -std=c++20 -common:microsoft_compiler_opts --copt /std:c++20 - # BuildBuddy common:linux --workspace_status_command=$(pwd)/.buildbuddy/workspace_status.sh common:windows --workspace_status_command=.buildbuddy/workspace_status.bat @@ -23,7 +16,6 @@ common:buildbuddy --bes_backend=grpcs://sacha.buildbuddy.io common:buildbuddy --remote_cache=grpcs://sacha.buildbuddy.io common:buildbuddy --remote_executor=grpcs://sacha.buildbuddy.io common:buildbuddy --experimental_remote_cache_compression -common:buildbuddy --jobs=50 common:buildbuddy --nolegacy_important_outputs common:buildbuddy --platforms=@buildbuddy_test//:buildbuddy_linux_x86_64 common:buildbuddy --extra_execution_platforms=@buildbuddy_test//:buildbuddy_linux_x86_64 diff --git a/.buildkite/linux_amd64.yml b/.buildkite/linux_amd64.yml index 6fec44b..decbd69 100644 --- a/.buildkite/linux_amd64.yml +++ b/.buildkite/linux_amd64.yml @@ -4,10 +4,10 @@ agents: steps: - label: ":bazel: Build and Test on gcc" commands: - - CC=gcc bazelisk build --config=default_compiler_opts //:LittleECSTests - - CC=gcc bazelisk test --config=default_compiler_opts //:LittleECSTests + - CC=gcc bazelisk build //:LittleECSTests + - CC=gcc bazelisk test //:LittleECSTests - label: ":bazel: Build and Test on Clang" commands: - - CC=clang bazelisk build --config=default_compiler_opts //:LittleECSTests - - CC=clang bazelisk test --config=default_compiler_opts //:LittleECSTests \ No newline at end of file + - CC=clang bazelisk build //:LittleECSTests + - CC=clang bazelisk test //:LittleECSTests \ No newline at end of file diff --git a/.buildkite/windows_amd64.yml b/.buildkite/windows_amd64.yml index 75354c1..105f89d 100644 --- a/.buildkite/windows_amd64.yml +++ b/.buildkite/windows_amd64.yml @@ -4,5 +4,5 @@ agents: steps: - label: ":bazel: Build" commands: - - bazelisk build --config=microsoft_compiler_opts //:LittleECSTests - - bazelisk test --config=microsoft_compiler_opts //:LittleECSTests + - bazelisk build //:LittleECSTests + - bazelisk test //:LittleECSTests diff --git a/.github/workflows/LittleECS.yml b/.github/workflows/LittleECS.yml index 7bb512b..f95598f 100644 --- a/.github/workflows/LittleECS.yml +++ b/.github/workflows/LittleECS.yml @@ -20,9 +20,9 @@ jobs: path: "~/.cache/bazel" key: bazel - name: Building... - run: bazelisk build --config=microsoft_compiler_opts //:LittleECSTests + run: bazelisk build //:LittleECSTests - name: Testing... - run: bazelisk test --config=microsoft_compiler_opts //:LittleECSTests + run: bazelisk test //:LittleECSTests ubuntu-latest-gcc: runs-on: ubuntu-latest @@ -37,9 +37,9 @@ jobs: - name: Version run: gcc --version - name: Building... - run: CC=gcc bazelisk build --config=default_compiler_opts //:LittleECSTests + run: CC=gcc bazelisk build //:LittleECSTests - name: Testing... - run: CC=gcc bazelisk test --config=default_compiler_opts //:LittleECSTests + run: CC=gcc bazelisk test //:LittleECSTests ubuntu-latest-clang: runs-on: ubuntu-latest @@ -59,6 +59,6 @@ jobs: - name: Version run: clang --version - name: Building... - run: CC=clang++-17 bazelisk build --config=default_compiler_opts //:LittleECSTests + run: CC=clang++-17 bazelisk build //:LittleECSTests - name: Testing... - run: CC=clang++-17 bazelisk test --config=default_compiler_opts //:LittleECSTests + run: CC=clang++-17 bazelisk test //:LittleECSTests diff --git a/.gitignore b/.gitignore index df84819..0181326 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ - -# bazel +# Bazel MODULE.bazel.lock bazel-bin bazel-out @@ -16,11 +15,12 @@ bazel-testlogs *.vcxproj.filters *.vcxproj.user -# Make +# VSCode +.vscode + +# Premake Makefile *.make - -# bin bin bin-int diff --git a/BUILD b/BUILD index f1fe707..a85a38e 100644 --- a/BUILD +++ b/BUILD @@ -7,6 +7,10 @@ cc_library( srcs = glob([ "src/**/*.h" ]), hdrs = glob([ "src/**/*.h" ]), includes = [ "src/" ], + copts = select({ + "@rules_cc//cc/compiler:msvc-cl": ["/std:c++20"], + "//conditions:default": ["-std=c++20"], + }), strip_include_prefix = "src", include_prefix = "LittleECS", linkstatic = True, @@ -15,18 +19,26 @@ cc_library( cc_test( name = "LittleECSTests", - includes = [ "src/" ], srcs = glob([ "Tests/**/*.h", "Tests/**/*.cpp" ], exclude=["Tests/Perf/**"]), + includes = [ "src/" ], defines = [ "LECS_USE_PROJECTCORE" ], + copts = select({ + "@rules_cc//cc/compiler:msvc-cl": ["/std:c++20"], + "//conditions:default": ["-std=c++20"], + }), deps = [ "@ProjectCore//:ProjectCore", ":LittleECS" ], visibility = ["//visibility:public"], ) cc_test( name = "LittleECSTestsPerf", - includes = [ "src/" ], srcs = glob([ "Tests/**/*.h", "Tests/**/*.cpp" ]), + includes = [ "src/" ], defines = [ "LECS_USE_PROJECTCORE" ], + copts = select({ + "@rules_cc//cc/compiler:msvc-cl": ["/std:c++20"], + "//conditions:default": ["-std=c++20"], + }), deps = [ "@ProjectCore//:ProjectCore", ":LittleECS" ], visibility = ["//visibility:public"], ) diff --git a/Docs/Workflow.md b/Docs/Workflow.md index 2e652cf..d0fc369 100644 --- a/Docs/Workflow.md +++ b/Docs/Workflow.md @@ -3,12 +3,7 @@ This doc is tigtelly related to the [Workflow example](../Examples/Workflow/main.cpp) To launch it, you can set your working directory to Examples/ and run: -- On Windows, using msvc: ``` - bazelisk run --config=msvc //Workflow:Workflow - ``` -- On Linux: (This `--config=linux` is not mandatory) - ``` - bazelisk run --config=linux //Workflow:Workflow + bazelisk run //Workflow:Workflow ``` diff --git a/Examples/.bazelrc b/Examples/.bazelrc index 4340403..39ef8d3 100644 --- a/Examples/.bazelrc +++ b/Examples/.bazelrc @@ -4,10 +4,3 @@ common --incompatible_strict_action_env common --show_timestamps common --verbose_failures test --test_output=errors - -# Opts -common:linux --config=default_compiler_opts -common:msvc --config=microsoft_compiler_opts - -common:default_compiler_opts --copt -std=c++20 -common:microsoft_compiler_opts --copt /std:c++20 diff --git a/Examples/README.md b/Examples/README.md index 3d3d4c4..75ee51f 100644 --- a/Examples/README.md +++ b/Examples/README.md @@ -4,24 +4,14 @@ ##### Build and Run examples one by one (Recommended) Example with `//Workflow:Workflow` (see below for the list of example) -- On Windows, using msvc: ``` - bazelisk run --config=msvc //Workflow:Workflow - ``` -- On Linux: (This `--config=linux` is not mandatory) - ``` - bazelisk run --config=linux //Workflow:Workflow + bazelisk run //Workflow:Workflow ``` ##### Compile all examples, then run binaries To compile every example: -- On Windows, using msvc: - ``` - bazelisk build --config=msvc //... - ``` -- On Linux: (This `--config=linux` is not mandatory) ``` - bazelisk build --config=linux //... + bazelisk build //... ``` Then you can run a program with (example with `//Workflow:Workflow`, see below for the list of example) diff --git a/Examples/Workflow/BUILD b/Examples/Workflow/BUILD index 4eef309..072516d 100644 --- a/Examples/Workflow/BUILD +++ b/Examples/Workflow/BUILD @@ -6,6 +6,10 @@ cc_binary( name = "Workflow", srcs = glob([ "*.h", "*.cpp" ]), defines = [ "LECS_USE_PROJECTCORE" ], + copts = select({ + "@rules_cc//cc/compiler:msvc-cl": ["/std:c++20"], + "//conditions:default": ["-std=c++20"], + }), deps = [ "@ProjectCore//:ProjectCore", "@littleecs//:LittleECS" ], visibility = ["//visibility:public"], ) diff --git a/Examples/Workflow/main.cpp b/Examples/Workflow/main.cpp index 92a259d..39174b3 100644 --- a/Examples/Workflow/main.cpp +++ b/Examples/Workflow/main.cpp @@ -43,6 +43,7 @@ int main() registry.Add(alice, "Alice"); registry.Add(bob, "Bob"); + /****** Get Components ******/ std::cout << std::endl; Logger.Info("Alice's int: {}", registry.Get(alice)); @@ -53,8 +54,8 @@ int main() std::cout << std::endl; /** * To ForEach on a specific Component, use ForEachUniqueComponent. - * It takes an lambda which can contains optionally an `LECS::EntityId` as first parameter, in that case the entityId will be send to the lambda - * The component you want to loop over is take as an template argument, and the lambda can take the component as: + * It takes an lambda which can contains optionally an `LECS::EntityId` as first parameter, in that case the entityId will be sent to the lambda + * The component you want to loop over is took as an template argument, and the lambda can take the component as: * - value * - const value * - const reference diff --git a/MODULE.bazel b/MODULE.bazel index bc938cc..db2bba9 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -13,5 +13,6 @@ http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "ht http_archive( name = "ProjectCore", urls = [ "https://github.com/0-Sacha/ProjectCore/archive/refs/heads/dev.zip" ], - strip_prefix = "ProjectCore-dev" + strip_prefix = "ProjectCore-dev", + integrity = "sha256-28v/wuBCDSekQV03i9/2Tn+AR9hllqPdCOMYOvHBwmI=", ) diff --git a/WORKSPACE b/WORKSPACE index 360da17..8da11b2 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -4,16 +4,16 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "bazel_utilities", - strip_prefix = "bazel_utilities-d748d078d0bdd4e5fe9020e8011a46edb484525e", - urls = [ "https://github.com/0-Sacha/bazel_utilities/archive/d748d078d0bdd4e5fe9020e8011a46edb484525e.zip" ], - integrity = "sha256-qakyhHoLPrGK/3zD+dWIL7wGSjLwMX69TiSGA05Wu2c=", + strip_prefix = "bazel_utilities-efe15a48c3b063436d6deecaa14b811083035993", + urls = [ "https://github.com/0-Sacha/bazel_utilities/archive/efe15a48c3b063436d6deecaa14b811083035993.zip" ], + integrity = "sha256-g1BUGaQFSLywkzTqixQdQTdrJ25TlcqG6PZXoCK7Jrw=", ) http_archive( name = "bazel_buildbuddy", - strip_prefix = "bazel_buildbuddy-89937f1942a9271348c0963ef89fb67c240c3afd", - urls = [ "https://github.com/0-Sacha/bazel_buildbuddy/archive/89937f1942a9271348c0963ef89fb67c240c3afd.zip" ], - integrity = "sha256-M8sEkfNBjSivQhIRYRzCXIq7ix3w23UckP0z9T/L3II=", + strip_prefix = "bazel_buildbuddy-b0840cf378c4aef5750b5e8bc87aa2ad1aeb874f", + urls = [ "https://github.com/0-Sacha/bazel_buildbuddy/archive/b0840cf378c4aef5750b5e8bc87aa2ad1aeb874f.zip" ], + integrity = "sha256-Wvbu4LB7F3d42Xj/dQyaGjVEntf4U3DO+aku3zEZD4I=", ) load("@bazel_buildbuddy//:rules.bzl", "buildbuddy_toolchain") From 3a4a0332307958e2e89b0f1a0701b388645e6243 Mon Sep 17 00:00:00 2001 From: BELLIER Sacha Date: Sat, 1 Jun 2024 23:22:06 +0200 Subject: [PATCH 2/4] fix: README --- Examples/README.md | 12 ++++++------ README.md | 2 -- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Examples/README.md b/Examples/README.md index 75ee51f..0e97e3b 100644 --- a/Examples/README.md +++ b/Examples/README.md @@ -4,15 +4,15 @@ ##### Build and Run examples one by one (Recommended) Example with `//Workflow:Workflow` (see below for the list of example) - ``` - bazelisk run //Workflow:Workflow - ``` +``` +bazelisk run //Workflow:Workflow +``` ##### Compile all examples, then run binaries To compile every example: - ``` - bazelisk build //... - ``` +``` +bazelisk build //... +``` Then you can run a program with (example with `//Workflow:Workflow`, see below for the list of example) ``` diff --git a/README.md b/README.md index 63d038b..d7126bd 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,4 @@ It can be used using [Bazel](https://bazel.build/). A `cc_library` rule has been created: `@LittleECS//:LittleECS`. You need to add the module `littleecs` to your dependencies. -You will need at least to give an c++ standard to use (at least c++20) since no one have been forced. You can check the [bazelrc](.bazelrc) to see how you can add one. - Not Recommended: There is also a [Premake](https://premake.github.io/docs/using-premake) configuration, thought it is deprecated (and run on a wrapper of mine: [PremakeUtilities](https://github.com/0-Sacha/PremakeUtilities)). I keep it for my Game Engine [Blackbird](https://github.com/0-Sacha/Blackbird) which is using `Premake` as Build system. From 8db40ed0500279a52efb52789c65cd6bc92256b1 Mon Sep 17 00:00:00 2001 From: BELLIER Sacha Date: Mon, 16 Sep 2024 14:50:25 +0200 Subject: [PATCH 3/4] feat: add external_dev as .gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 0181326..071a0ef 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,6 @@ ADD_MANY_COMPONENT_100K.json ADD_MANY_COMPONENT_100M.json ADD_MANY_COMPONENT_1K.json ADD_MANY_COMPONENT_10M.json + +# External Dev +external_dev From dedbaec1de1f9c995ace094ee9709838c1d8749f Mon Sep 17 00:00:00 2001 From: BELLIER Sacha Date: Mon, 16 Sep 2024 15:18:59 +0200 Subject: [PATCH 4/4] feat: ProjectCore -> StreamFormat --- .vscode/c_cpp_properties.json | 2 +- BUILD | 8 ++++---- Examples/MODULE.bazel | 6 +++--- Examples/README.md | 2 +- Examples/Workflow/BUILD | 4 ++-- Examples/Workflow/main.cpp | 6 +++--- MODULE.bazel | 7 +++---- Tests/BaseLittleECSTest.h | 2 +- Tests/BasicWorkflow.cpp | 2 +- Tests/Perf/PerformanceTest.cpp | 18 +++++++++--------- Tests/Tests.cpp | 6 +++--- premake5.lua | 4 ++-- src/LittleECS/Core/Core.h | 4 ++-- .../{UseProjectCore.h => UseStreamFormat.h} | 8 ++++---- src/LittleECS/Detail/ComponentId.h | 2 +- src/LittleECS/Detail/EntityId.h | 4 ++-- 16 files changed, 42 insertions(+), 43 deletions(-) rename src/LittleECS/Core/{UseProjectCore.h => UseStreamFormat.h} (70%) diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 33e4d94..7f5cacd 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -4,7 +4,7 @@ "name": "Default Windows", "includePath": [ "src/", - "bazel-littleecs/external/_main~_repo_rules~ProjectCore/src/" + "bazel-littleecs/external/_main~_repo_rules~StreamFormat/src/" ], "cStandard": "c17", "cppStandard": "c++20", diff --git a/BUILD b/BUILD index a85a38e..e3af315 100644 --- a/BUILD +++ b/BUILD @@ -21,12 +21,12 @@ cc_test( name = "LittleECSTests", srcs = glob([ "Tests/**/*.h", "Tests/**/*.cpp" ], exclude=["Tests/Perf/**"]), includes = [ "src/" ], - defines = [ "LECS_USE_PROJECTCORE" ], + defines = [ "LECS_USE_STREAMFORMAT" ], copts = select({ "@rules_cc//cc/compiler:msvc-cl": ["/std:c++20"], "//conditions:default": ["-std=c++20"], }), - deps = [ "@ProjectCore//:ProjectCore", ":LittleECS" ], + deps = [ "@StreamFormat//:StreamFormat", ":LittleECS" ], visibility = ["//visibility:public"], ) @@ -34,11 +34,11 @@ cc_test( name = "LittleECSTestsPerf", srcs = glob([ "Tests/**/*.h", "Tests/**/*.cpp" ]), includes = [ "src/" ], - defines = [ "LECS_USE_PROJECTCORE" ], + defines = [ "LECS_USE_STREAMFORMAT" ], copts = select({ "@rules_cc//cc/compiler:msvc-cl": ["/std:c++20"], "//conditions:default": ["-std=c++20"], }), - deps = [ "@ProjectCore//:ProjectCore", ":LittleECS" ], + deps = [ "@StreamFormat//:StreamFormat", ":LittleECS" ], visibility = ["//visibility:public"], ) diff --git a/Examples/MODULE.bazel b/Examples/MODULE.bazel index 68148e3..d858191 100644 --- a/Examples/MODULE.bazel +++ b/Examples/MODULE.bazel @@ -17,7 +17,7 @@ local_path_override( http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( - name = "ProjectCore", - urls = [ "https://github.com/0-Sacha/ProjectCore/archive/refs/heads/dev.zip" ], - strip_prefix = "ProjectCore-dev" + name = "StreamFormat", + urls = [ "https://github.com/0-Sacha/StreamFormat/archive/refs/heads/dev.zip" ], + strip_prefix = "StreamFormat-dev" ) diff --git a/Examples/README.md b/Examples/README.md index 0e97e3b..2b75fe8 100644 --- a/Examples/README.md +++ b/Examples/README.md @@ -1,4 +1,4 @@ -# Example of ProjectCore +# Example of StreamFormat ### Try thoses examples ! diff --git a/Examples/Workflow/BUILD b/Examples/Workflow/BUILD index 072516d..3679cdf 100644 --- a/Examples/Workflow/BUILD +++ b/Examples/Workflow/BUILD @@ -5,11 +5,11 @@ load("@rules_cc//cc:defs.bzl", "cc_binary") cc_binary( name = "Workflow", srcs = glob([ "*.h", "*.cpp" ]), - defines = [ "LECS_USE_PROJECTCORE" ], + defines = [ "LECS_USE_STREAMFORMAT" ], copts = select({ "@rules_cc//cc/compiler:msvc-cl": ["/std:c++20"], "//conditions:default": ["-std=c++20"], }), - deps = [ "@ProjectCore//:ProjectCore", "@littleecs//:LittleECS" ], + deps = [ "@StreamFormat//:StreamFormat", "@littleecs//:LittleECS" ], visibility = ["//visibility:public"], ) diff --git a/Examples/Workflow/main.cpp b/Examples/Workflow/main.cpp index 39174b3..9978707 100644 --- a/Examples/Workflow/main.cpp +++ b/Examples/Workflow/main.cpp @@ -1,8 +1,8 @@ #include "LittleECS/LittleECS.h" -#include "ProjectCore/FLog.h" +#include "StreamFormat/FLog.h" -ProjectCore::FLog::BasicLogger Logger("Workflow"); +StreamFormat::FLog::BasicLogger Logger("Workflow"); /****** Components ******/ struct ASmallComponent @@ -20,7 +20,7 @@ struct Name std::string Name; }; // To be able to Format the struct Name -PROJECTCORE_AUTO_FORMATTER(Name, "{}", value.Name); +STREAMFORMAT_AUTO_FORMATTER(Name, "{}", value.Name); int main() { diff --git a/MODULE.bazel b/MODULE.bazel index db2bba9..c5bda94 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -11,8 +11,7 @@ bazel_dep(name = "rules_cc", version = "0.0.9") http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( - name = "ProjectCore", - urls = [ "https://github.com/0-Sacha/ProjectCore/archive/refs/heads/dev.zip" ], - strip_prefix = "ProjectCore-dev", - integrity = "sha256-28v/wuBCDSekQV03i9/2Tn+AR9hllqPdCOMYOvHBwmI=", + name = "StreamFormat", + urls = [ "https://github.com/0-Sacha/StreamFormat/archive/refs/heads/dev.zip" ], + strip_prefix = "StreamFormat-dev", ) diff --git a/Tests/BaseLittleECSTest.h b/Tests/BaseLittleECSTest.h index 90f2470..17add83 100644 --- a/Tests/BaseLittleECSTest.h +++ b/Tests/BaseLittleECSTest.h @@ -1,5 +1,5 @@ #pragma once -#include "ProjectCore/Tester/TestSuite/AllTestSuite.h" +#include "StreamFormat/Tester/TestSuite/AllTestSuite.h" inline PCT_TEST_SUITE(LITTLE_ECS); diff --git a/Tests/BasicWorkflow.cpp b/Tests/BasicWorkflow.cpp index 4fba4ce..5192409 100644 --- a/Tests/BasicWorkflow.cpp +++ b/Tests/BasicWorkflow.cpp @@ -2,7 +2,7 @@ #include "LittleECS/LittleECS.h" -#include "ProjectCore/ProfilerManager.h" +#include "StreamFormat/ProfilerManager.h" #include diff --git a/Tests/Perf/PerformanceTest.cpp b/Tests/Perf/PerformanceTest.cpp index e16f8bb..7d6a955 100644 --- a/Tests/Perf/PerformanceTest.cpp +++ b/Tests/Perf/PerformanceTest.cpp @@ -2,7 +2,7 @@ #include "LittleECS/LittleECS.h" -#include "ProjectCore/ProfilerManager.h" +#include "StreamFormat/ProfilerManager.h" #include @@ -35,7 +35,7 @@ struct LECS::Detail::ComponentStorageInfo : public DefaultCom #define BenchmarkTest(Size, Name) PCT_TEST_FUNC(PERFORMANCE, ADD_MANY_COMPONENT_ ## Name) \ { \ - ProjectCore::ProfilerManager::Profiler profiler("ADD_MANY_COMPONENT_" #Name); \ + StreamFormat::ProfilerManager::Profiler profiler("ADD_MANY_COMPONENT_" #Name); \ \ LECS::Registry registry; \ \ @@ -43,7 +43,7 @@ struct LECS::Detail::ComponentStorageInfo : public DefaultCom entities.reserve(Size); \ \ { \ - ProjectCore::ProfilerManager::ScopeProfile scope(profiler, "Create Entities"); \ + StreamFormat::ProfilerManager::ScopeProfile scope(profiler, "Create Entities"); \ \ for (std::size_t i = 0; i < Size; ++i) \ { \ @@ -52,7 +52,7 @@ struct LECS::Detail::ComponentStorageInfo : public DefaultCom } \ \ { \ - ProjectCore::ProfilerManager::ScopeProfile scope(profiler, "Check Entities Ids"); \ + StreamFormat::ProfilerManager::ScopeProfile scope(profiler, "Check Entities Ids"); \ \ bool uid = true; \ \ @@ -91,7 +91,7 @@ struct LECS::Detail::ComponentStorageInfo : public DefaultCom } \ \ { \ - ProjectCore::ProfilerManager::ScopeProfile scope(profiler, "Add Component"); \ + StreamFormat::ProfilerManager::ScopeProfile scope(profiler, "Add Component"); \ \ for (std::size_t i = 0; i < Size; ++i) \ { \ @@ -100,7 +100,7 @@ struct LECS::Detail::ComponentStorageInfo : public DefaultCom } \ \ { \ - ProjectCore::ProfilerManager::ScopeProfile scope(profiler, "Get Component"); \ + StreamFormat::ProfilerManager::ScopeProfile scope(profiler, "Get Component"); \ \ for (std::size_t i = 0; i < Size; ++i) \ { \ @@ -109,7 +109,7 @@ struct LECS::Detail::ComponentStorageInfo : public DefaultCom } \ \ { \ - ProjectCore::ProfilerManager::ScopeProfile scope(profiler, "Has Component"); \ + StreamFormat::ProfilerManager::ScopeProfile scope(profiler, "Has Component"); \ \ for (std::size_t i = 0; i < Size; ++i) \ { \ @@ -119,7 +119,7 @@ struct LECS::Detail::ComponentStorageInfo : public DefaultCom } \ \ { \ - ProjectCore::ProfilerManager::ScopeProfile scope(profiler, "ForEach Component"); \ + StreamFormat::ProfilerManager::ScopeProfile scope(profiler, "ForEach Component"); \ \ registry.ForEachUniqueComponent([](LECS::EntityId, BasicIntComponent& k) \ { \ @@ -127,7 +127,7 @@ struct LECS::Detail::ComponentStorageInfo : public DefaultCom }); \ } \ \ - ProjectCore::ProfilerManager::ProfilerFactory::ToJson(profiler); \ + StreamFormat::ProfilerManager::ProfilerFactory::ToJson(profiler); \ } BenchmarkTest(1'000, 1K); diff --git a/Tests/Tests.cpp b/Tests/Tests.cpp index 090a463..ad2d7f5 100644 --- a/Tests/Tests.cpp +++ b/Tests/Tests.cpp @@ -1,8 +1,8 @@ -#include "ProjectCore/Tester/TestSuite/AllTestSuite.h" +#include "StreamFormat/Tester/TestSuite/AllTestSuite.h" int main() { - ProjectCore::Tester::TestSuitesManager::Verbose = false; - return ProjectCore::Tester::TestSuitesManager::ExecAllTestSuites(); + StreamFormat::Tester::TestSuitesManager::Verbose = false; + return StreamFormat::Tester::TestSuitesManager::ExecAllTestSuites(); } diff --git a/premake5.lua b/premake5.lua index 18c67b7..5c0799c 100644 --- a/premake5.lua +++ b/premake5.lua @@ -10,11 +10,11 @@ Solution.Projects["LittleECS"].Defines = { "LECS_ENABLE_EACH" } Solution.Projects["LittleECS"].ProjectDependencies = { - "ProjectCore" + "StreamFormat" } project "LittleECS" - kind (Solution.Projects["ProjectCore"].Type) + kind (Solution.Projects["StreamFormat"].Type) language "C++" cppdialect "C++20" diff --git a/src/LittleECS/Core/Core.h b/src/LittleECS/Core/Core.h index 712a835..a012acc 100644 --- a/src/LittleECS/Core/Core.h +++ b/src/LittleECS/Core/Core.h @@ -13,8 +13,8 @@ #define LECS_LOGGER_ENABLE #endif -#ifdef LECS_USE_PROJECTCORE - #include "UseProjectCore.h" +#ifdef LECS_USE_STREAMFORMAT + #include "UseStreamFormat.h" #endif #ifdef LECS_LOGGER_ENABLE diff --git a/src/LittleECS/Core/UseProjectCore.h b/src/LittleECS/Core/UseStreamFormat.h similarity index 70% rename from src/LittleECS/Core/UseProjectCore.h rename to src/LittleECS/Core/UseStreamFormat.h index 0aaedaa..c105a64 100644 --- a/src/LittleECS/Core/UseProjectCore.h +++ b/src/LittleECS/Core/UseStreamFormat.h @@ -1,18 +1,18 @@ #pragma once -#include "ProjectCore/FMT.h" +#include "StreamFormat/FMT.h" #ifdef LECS_LOGGER_ENABLE - #include "ProjectCore/FLog.h" + #include "StreamFormat/FLog.h" namespace LECS { class Core { public: - static ProjectCore::FLog::BasicLogger& Logger() { return m_Logger; } + static StreamFormat::FLog::BasicLogger& Logger() { return m_Logger; } private: - static inline ProjectCore::FLog::BasicLogger m_Logger{}; + static inline StreamFormat::FLog::BasicLogger m_Logger{}; }; } diff --git a/src/LittleECS/Detail/ComponentId.h b/src/LittleECS/Detail/ComponentId.h index ab72db6..b1df616 100644 --- a/src/LittleECS/Detail/ComponentId.h +++ b/src/LittleECS/Detail/ComponentId.h @@ -49,7 +49,7 @@ namespace LECS } } -namespace ProjectCore::FMT +namespace StreamFormat::FMT { template struct FormatterType { diff --git a/src/LittleECS/Detail/EntityId.h b/src/LittleECS/Detail/EntityId.h index 352e6aa..7fa24b1 100644 --- a/src/LittleECS/Detail/EntityId.h +++ b/src/LittleECS/Detail/EntityId.h @@ -49,8 +49,8 @@ namespace LECS } } -#ifdef PROJECTCORE_FORMATTER_DECLARED - namespace ProjectCore::FMT +#ifdef STREAMFORMAT_FORMATTER_DECLARED + namespace StreamFormat::FMT { template struct FormatterType {