-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
50 changed files
with
1,370 additions
and
1,054 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Examples/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Common | ||
common --enable_platform_specific_config | ||
common --incompatible_strict_action_env | ||
common --toolchain_resolution_debug=all | ||
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 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@echo off | ||
call PowerShell -NoProfile -ExecutionPolicy Bypass -Command "%CD%\.buildbuddy\workspace_status.ps1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# This script will be run by Bazel when the building process starts to | ||
# generate key-value information that represents the status of the | ||
# workspace. The output should be like | ||
# | ||
# KEY1 VALUE1 | ||
# KEY2 VALUE2 | ||
# | ||
# If the script exits with a non-zero code, it's considered as a failure | ||
# and the output will be discarded. | ||
|
||
$ErrorActionPreference = "Stop" | ||
|
||
# Get the repository URL without credentials | ||
$repo_url = (git config --get remote.origin.url) -replace '//.*?:.*?@', '//' | ||
$repo_url = $repo_url -replace '^[email protected]:', 'https://github.com/' | ||
$urrepo_urll = $repo_url -replace '\.git$' | ||
Write-Output "REPO_URL $repo_url" | ||
|
||
# Get the commit SHA | ||
$commit_sha = git rev-parse HEAD | ||
Write-Output "COMMIT_SHA $commit_sha" | ||
|
||
# Get the current Git branch | ||
$git_branch = git rev-parse --abbrev-ref HEAD | ||
Write-Output "GIT_BRANCH $git_branch" | ||
|
||
# Check if there are any modified files in the working directory | ||
if (git diff-index --quiet HEAD) { | ||
$git_tree_status = 'Clean' | ||
} else { | ||
$git_tree_status = 'Modified' | ||
} | ||
Write-Output "GIT_TREE_STATUS $git_tree_status" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
# This script will be run bazel when building process starts to | ||
# generate key-value information that represents the status of the | ||
# workspace. The output should be like | ||
# | ||
# KEY1 VALUE1 | ||
# KEY2 VALUE2 | ||
# | ||
# If the script exits with non-zero code, it's considered as a failure | ||
# and the output will be discarded. | ||
|
||
set -eo pipefail # exit immediately if any command fails. | ||
|
||
function remove_url_credentials() { | ||
which perl >/dev/null && perl -pe 's#//.*?:.*?@#//#' || cat | ||
} | ||
|
||
repo_url=$(git config --get remote.origin.url | remove_url_credentials) | ||
repo_url=${repo_url/git@github.com:/https://github.com/} | ||
repo_url=${repo_url%.git} | ||
echo "REPO_URL $repo_url" | ||
|
||
commit_sha=$(git rev-parse HEAD) | ||
echo "COMMIT_SHA $commit_sha" | ||
|
||
git_branch=$(git rev-parse --abbrev-ref HEAD) | ||
echo "GIT_BRANCH $git_branch" | ||
|
||
git_tree_status=$(git diff-index --quiet HEAD -- && echo 'Clean' || echo 'Modified') | ||
echo "GIT_TREE_STATUS $git_tree_status" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
agents: | ||
queue: "agent-runners-linux-amd64" | ||
|
||
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 | ||
|
||
- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
steps: | ||
- label: ":pipeline: Launch Windows Pipeline" | ||
command: "buildkite-agent pipeline upload .buildkite/windows_amd64.yml" | ||
- label: ":pipeline: Launch Linux Pipeline" | ||
command: "buildkite-agent pipeline upload .buildkite/linux_amd64.yml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
name: "ProjectCore" | ||
steps: | ||
- label: ":pipeline: Launch Embbeded Pipeline" | ||
command: "buildkite-agent pipeline upload .builkite/pipeline.yml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
agents: | ||
queue: "agent-runners-windows-amd64" | ||
|
||
steps: | ||
- label: ":bazel: Build" | ||
commands: | ||
- bazelisk build --config=microsoft_compiler_opts //:LittleECSTests | ||
- bazelisk test --config=microsoft_compiler_opts //:LittleECSTests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: ProjectCore | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
pull_request: | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
windows-latest-msvc: | ||
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: Building... | ||
run: bazelisk build --config=microsoft_compiler_opts //:LittleECSTests | ||
- name: Testing... | ||
run: bazelisk test --config=microsoft_compiler_opts //:LittleECSTests | ||
|
||
ubuntu-latest-gcc: | ||
runs-on: ubuntu-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: Version | ||
run: gcc --version | ||
- name: Building... | ||
run: CC=gcc bazelisk build --config=default_compiler_opts //:LittleECSTests | ||
- name: Testing... | ||
run: CC=gcc bazelisk test --config=default_compiler_opts //:LittleECSTests | ||
|
||
ubuntu-latest-clang: | ||
runs-on: ubuntu-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: Install clang | ||
run: | | ||
wget https://apt.llvm.org/llvm.sh | ||
chmod +x ./llvm.sh | ||
sudo ./llvm.sh 17 | ||
- name: Version | ||
run: clang --version | ||
- name: Building... | ||
run: CC=clang++-17 bazelisk build --config=default_compiler_opts //:LittleECSTests | ||
- name: Testing... | ||
run: CC=clang++-17 bazelisk test --config=default_compiler_opts //:LittleECSTests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"configurations": [ | ||
{ | ||
"name": "Win32", | ||
"includePath": [ | ||
"${workspaceFolder}/**" | ||
], | ||
"defines": [ | ||
"_DEBUG", | ||
"UNICODE", | ||
"_UNICODE" | ||
], | ||
"windowsSdkVersion": "10.0.22000.0", | ||
"compilerPath": "cl.exe", | ||
"cStandard": "c17", | ||
"cppStandard": "c++17", | ||
"intelliSenseMode": "windows-msvc-x64" | ||
} | ||
], | ||
"version": 4 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
"" | ||
|
||
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") | ||
|
||
cc_library( | ||
name = "LittleECS", | ||
srcs = glob([ "src/**/*.h" ]), | ||
hdrs = glob([ "src/**/*.h" ]), | ||
includes = [ "src/" ], | ||
strip_include_prefix = "src", | ||
include_prefix = "LittleECS", | ||
linkstatic = True, | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
cc_test( | ||
name = "LittleECSTests", | ||
includes = [ "src/" ], | ||
srcs = glob([ "Tests/**/*.h", "Tests/**/*.cpp" ], exclude=["Tests/Perf/**"]), | ||
defines = [ "LECS_USE_PROJECTCORE" ], | ||
deps = [ "@ProjectCore//:ProjectCore", ":LittleECS" ], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
cc_test( | ||
name = "LittleECSTestsPerf", | ||
includes = [ "src/" ], | ||
srcs = glob([ "Tests/**/*.h", "Tests/**/*.cpp" ]), | ||
defines = [ "LECS_USE_PROJECTCORE" ], | ||
deps = [ "@ProjectCore//:ProjectCore", ":LittleECS" ], | ||
visibility = ["//visibility:public"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
"" | ||
|
||
# buildifier: disable=module-docstring | ||
module( | ||
name = "littleecs", | ||
version = "0.1", | ||
repo_name = "com_sacha_littleecs", | ||
) | ||
|
||
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" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
plugins: | ||
- repo: buildbuddy-io/plugins | ||
path: open-invocation | ||
- repo: siggisim/theme-modern | ||
- repo: buildbuddy-io/plugins | ||
path: notify | ||
|
||
actions: | ||
- name: "BuildBuddy Workflows" | ||
triggers: | ||
push: | ||
branches: | ||
- "*" | ||
pull_request: | ||
branches: | ||
- "*" | ||
bazel_commands: | ||
- "test --remote_header=x-buildbuddy-api-key=$BUILDBUDDY_RBEKEY_WINDOWS_WSL //..." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#pragma once | ||
|
||
#ifndef LECS_DO_NOT_USE_DEFAULT_MACRO | ||
#if defined(__clang__) | ||
#define LECS_COMPILER_CLANG | ||
#elif defined(__GNUC__) || defined(__GNUG__) | ||
#define LECS_COMPILER_GCC | ||
#elif defined(_MSC_VER) | ||
#define LECS_COMPILER_MSVC | ||
#endif | ||
|
||
#ifdef LECS_COMPILER_MSVC | ||
#ifdef _DEBUG | ||
#define LECS_DEBUG | ||
#endif | ||
#endif | ||
|
||
#if defined(LECS_COMPILER_CLANG) || defined(LECS_COMPILER_GCC) | ||
#if !defined(NDEBUG) | ||
#define LECS_DEBUG | ||
#endif | ||
#endif | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#pragma once | ||
|
||
#include "CompilerInfo.h" | ||
|
||
#include <utility> | ||
|
||
#ifdef LECS_DEBUG | ||
#define LECS_LOGGER_ENABLE | ||
#define LECS_ASSERT_ENABLE | ||
#endif | ||
|
||
#ifdef LECS_ASSERT_ENABLE | ||
#define LECS_LOGGER_ENABLE | ||
#endif | ||
|
||
#ifdef LECS_LOGGER_ENABLE | ||
#ifdef LECS_USE_PROJECTCORE | ||
#include "UseProjectCore.h" | ||
#endif | ||
|
||
#define LECS_TRACE(...) // TODO: ? | ||
#define LECS_INFO(...) // TODO: ? | ||
#define LECS_WARN(...) // TODO: ? | ||
#define LECS_ERROR(...) // TODO: ? | ||
#define LECS_FATAL(...) // TODO: ? | ||
#else | ||
#define LECS_TRACE(...) | ||
#define LECS_INFO(...) | ||
#define LECS_WARN(...) | ||
#define LECS_ERROR(...) | ||
#define LECS_FATAL(...) | ||
#endif | ||
|
||
#ifdef LECS_ASSERT_ENABLE | ||
#ifdef LECS_COMPILER_MSVC | ||
#define LECS_ASSERT(x, ...) if(!(x)) { LECS_FATAL("ASSERT FAILED! : " #x __VA_ARGS__); __debugbreak(); } | ||
#else | ||
#include <csignal> | ||
#define LECS_ASSERT(x, ...) if(!(x)) { LECS_FATAL("ASSERT FAILED! : " #x __VA_ARGS__); std::raise(SIGINT); } | ||
#endif | ||
#else | ||
#define LECS_ASSERT(...) | ||
#endif |
Oops, something went wrong.