Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: module #5

Merged
merged 4 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,23 @@ common --show_timestamps
common --verbose_failures
test --test_output=errors

# Winlibs
common:winlibs-gcc --extra_toolchains=@lecs-winlibs//:gcc-toolchain
common:winlibs-clang --extra_toolchains=@lecs-pthread-winlibs//:clang-toolchain

# BuildBuddy
common:linux --workspace_status_command=$(pwd)/.buildbuddy/workspace_status.sh
common:windows --workspace_status_command=.buildbuddy/workspace_status.bat

#
common:buildbuddy --build_metadata=ROLE=CI
common:buildbuddy --bes_results_url=https://sacha.buildbuddy.io/invocation/
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 --nolegacy_important_outputs
common:buildbuddy --platforms=@buildbuddy_test//:buildbuddy_linux_x86_64
common:buildbuddy --extra_execution_platforms=@buildbuddy_test//:buildbuddy_linux_x86_64
common:buildbuddy --jobs=50
common:buildbuddy --remote_instance_name=littleecs
common:buildbuddy --extra_toolchains=@buildbuddy_test//:toolchain_buildbuddy_gcc_12
#
common:buildbuddy --extra_execution_platforms=@lecs-buildbuddy//:platform
common:buildbuddy --extra_toolchains=@lecs-buildbuddy//:gcc-toolchain
common:buildbuddy --platforms=@lecs-buildbuddy//:platform
8 changes: 7 additions & 1 deletion .buildkite/windows_amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@ agents:
steps:
- label: ":bazel: Build"
commands:
- bazelisk build //:LittleECSTests
- bazelisk test //:LittleECSTests

- label: ":bazel: Build And Test Winlibs/clang"
commands:
- bazelisk build --config=winlibs-clang //:LittleECSTests
- label: ":bazel: Build And Test Winlibs/gcc"
commands:
- bazelisk build --config=winlibs-gcc //:LittleECSTests
15 changes: 15 additions & 0 deletions .github/workflows/LittleECS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,21 @@ jobs:
run: bazelisk build //:LittleECSTests
- name: Testing...
run: bazelisk test //:LittleECSTests

windows-latest-winlibs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: bazelbuild/setup-bazelisk@v3
- name: Mount bazel cache
uses: actions/cache@v4
with:
path: "~/.cache/bazel"
key: bazel
- name: Build Winlibs/clang...
run: bazelisk build --config=winlibs-clang //:LittleECSTests
- name: Build Winlibs/gcc...
run: bazelisk build --config=winlibs-gcc //:LittleECSTests

ubuntu-latest-gcc:
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions BUILD → BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ cc_test(
"@rules_cc//cc/compiler:msvc-cl": ["/std:c++20"],
"//conditions:default": ["-std=c++20"],
}),
deps = [ "@StreamFormat//:StreamFormat", ":LittleECS" ],
deps = [ "@streamformat//:StreamFormat", ":LittleECS" ],
visibility = ["//visibility:public"],
)

Expand All @@ -39,6 +39,6 @@ cc_test(
"@rules_cc//cc/compiler:msvc-cl": ["/std:c++20"],
"//conditions:default": ["-std=c++20"],
}),
deps = [ "@StreamFormat//:StreamFormat", ":LittleECS" ],
deps = [ "@streamformat//:StreamFormat", ":LittleECS" ],
visibility = ["//visibility:public"],
)
29 changes: 17 additions & 12 deletions Examples/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,25 @@
module(
name = "littleecs_examples",
version = "0.1",
repo_name = "com_sacha_littleecs_examples",
)

bazel_dep(name = "rules_cc", version = "0.0.9")
git_override(module_name="bazel_utilities", remote="https://github.com/0-Sacha/bazel_utilities.git", commit="7f6c3585c41278918428ed48d45b12413c197fc0")
git_override(module_name="bazel_buildbuddy", remote="https://github.com/0-Sacha/bazel_buildbuddy.git", commit="b60314cac7826edb87efe285b032b877ad725f84")
git_override(module_name="bazel_winlibs", remote="https://github.com/0-Sacha/bazel_winlibs.git", commit="e2cc97b61cb9115fbc2b7169dc9d1cb36b351935")
git_override(module_name="streamformat", remote="https://github.com/0-Sacha/StreamFormat.git", commit="6faa20c9176b14e81903d0d65ad06e6a6e36332b")
local_path_override(module_name = "littleecs", path = "../")

bazel_dep(name = "rules_cc", version = "0.0.10")
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "bazel_utilities", version = "0.0.1")
bazel_dep(name = "bazel_winlibs", version = "0.0.1")

bazel_dep(name = "streamformat", version = "0.1")
bazel_dep(name = "littleecs")
local_path_override(
module_name = "littleecs",
path = "../",
)

http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "StreamFormat",
urls = [ "https://github.com/0-Sacha/StreamFormat/archive/refs/heads/dev.zip" ],
strip_prefix = "StreamFormat-dev"
)
winlibs_toolchain_extension = use_extension("@bazel_winlibs//:rules.bzl", "winlibs_toolchain_extension")
inject_repo(winlibs_toolchain_extension, "platforms", "bazel_utilities")
winlibs_toolchain_extension.winlibs_toolchain(name = "ex_winlibs")
winlibs_toolchain_extension.winlibs_toolchain(name = "pthread-ex_winlibs", linklibs = [ "pthread" ])
use_repo(winlibs_toolchain_extension, "ex_winlibs")
use_repo(winlibs_toolchain_extension, "pthread-ex_winlibs")
2 changes: 1 addition & 1 deletion Examples/Workflow/BUILD → Examples/Workflow/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ cc_binary(
"@rules_cc//cc/compiler:msvc-cl": ["/std:c++20"],
"//conditions:default": ["-std=c++20"],
}),
deps = [ "@StreamFormat//:StreamFormat", "@littleecs//:LittleECS" ],
deps = [ "@streamformat//:StreamFormat", "@littleecs//:LittleECS" ],
visibility = ["//visibility:public"],
)
39 changes: 32 additions & 7 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,39 @@
module(
name = "littleecs",
version = "0.1",
repo_name = "com_sacha_littleecs",
)

bazel_dep(name = "rules_cc", version = "0.0.9")
git_override(module_name="bazel_utilities", remote="https://github.com/0-Sacha/bazel_utilities.git", commit="7f6c3585c41278918428ed48d45b12413c197fc0")
git_override(module_name="bazel_buildbuddy", remote="https://github.com/0-Sacha/bazel_buildbuddy.git", commit="b60314cac7826edb87efe285b032b877ad725f84")
git_override(module_name="bazel_winlibs", remote="https://github.com/0-Sacha/bazel_winlibs.git", commit="e2cc97b61cb9115fbc2b7169dc9d1cb36b351935")
git_override(module_name="streamformat", remote="https://github.com/0-Sacha/StreamFormat.git", commit="6faa20c9176b14e81903d0d65ad06e6a6e36332b")

http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "StreamFormat",
urls = [ "https://github.com/0-Sacha/StreamFormat/archive/refs/heads/dev.zip" ],
strip_prefix = "StreamFormat-dev",
bazel_dep(name = "rules_cc", version = "0.0.10")
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "bazel_utilities", version = "0.0.1")
bazel_dep(name = "bazel_buildbuddy", version = "0.0.1")
bazel_dep(name = "bazel_winlibs", version = "0.0.1")

bazel_dep(name = "streamformat", version = "0.1")

bazel_dep(name = "hedron_compile_commands", dev_dependency = True)
git_override(
module_name = "hedron_compile_commands",
remote = "https://github.com/hedronvision/bazel-compile-commands-extractor.git",
commit = "1e08f8e0507b6b6b1f4416a9a22cf5c28beaba93",
)

# Technically no need for this since their are already defined in 'streamformat'
winlibs_toolchain_extension = use_extension("@bazel_winlibs//:rules.bzl", "winlibs_toolchain_extension")
inject_repo(winlibs_toolchain_extension, "platforms", "bazel_utilities")
winlibs_toolchain_extension.winlibs_toolchain(name = "lecs-winlibs")
winlibs_toolchain_extension.winlibs_toolchain(name = "lecs-pthread-winlibs", linklibs = [ "pthread" ])
use_repo(winlibs_toolchain_extension, "lecs-winlibs")
use_repo(winlibs_toolchain_extension, "lecs-pthread-winlibs")
# register_toolchains("@winlibs//:clang-toolchain")

buildbuddy_toolchain_extension = use_extension("@bazel_buildbuddy//:rules.bzl", "buildbuddy_toolchain_extension")
inject_repo(buildbuddy_toolchain_extension, "platforms", "bazel_utilities")
buildbuddy_toolchain_extension.buildbuddy_toolchain(name = "lecs-buildbuddy")
use_repo(buildbuddy_toolchain_extension, "lecs-buildbuddy")
# register_toolchains("@buildbuddy//:gcc-toolchain")
24 changes: 0 additions & 24 deletions WORKSPACE

This file was deleted.

13 changes: 13 additions & 0 deletions conf/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""
"""

load("@hedron_compile_commands//:refresh_compile_commands.bzl", "refresh_compile_commands")

refresh_compile_commands(
name = "compile_commands",
exclude_external_sources = True,
exclude_headers = "external",
targets = {
"//:LittleECS": "",
},
)
5 changes: 3 additions & 2 deletions src/LittleECS/Detail/ComponentId.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ namespace LECS
namespace StreamFormat::FMT
{
template<typename FormatterContext>
struct FormatterType<LECS::ComponentId, FormatterContext> {
struct FormatterType<LECS::ComponentId, FormatterContext>
{
static void Format(LECS::ComponentId typeId, FormatterContext& context)
{
FormatterType<Detail::ForwardAsUInt<typename LECS::ComponentId::Type>, FormatterContext>::Format(typeId, context);
FormatterType<typename LECS::ComponentId::Type, FormatterContext>::Format(typeId, context);
}
};
}
5 changes: 3 additions & 2 deletions src/LittleECS/Detail/EntityId.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,11 @@ namespace LECS
namespace StreamFormat::FMT
{
template<typename FormatterContext>
struct FormatterType<LECS::EntityId, FormatterContext> {
struct FormatterType<LECS::EntityId, FormatterContext>
{
static void Format(LECS::EntityId typeId, FormatterContext& context)
{
FormatterType<Detail::ForwardAsUInt<typename LECS::EntityId::Type>, FormatterContext>::Format(typeId, context);
FormatterType<typename LECS::EntityId::Type, FormatterContext>::Format(typeId, context);
}
};
}
Expand Down