-
Notifications
You must be signed in to change notification settings - Fork 22
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
32 changed files
with
800 additions
and
9 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,14 @@ | ||
common --enable_bzlmod | ||
common --registry=https://bcr.bazel.build | ||
try-import %workspace%/.bazelrc.user | ||
|
||
# bazel from apt needs access to this cacerts location | ||
startup --host_jvm_args=-Djavax.net.ssl.trustStore=/etc/ssl/certs/java/cacerts | ||
|
||
# So we can support private dependencies | ||
build --experimental_cc_implementation_deps | ||
|
||
build --action_env=BAZEL_CXXOPTS="-std=c++17" | ||
build --strip=never | ||
build --copt='-O2' | ||
build --conlyopt='-std=c11' |
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,8 @@ | ||
load("//:plugin.bzl", "CLOE_PLUGINS") | ||
|
||
sh_binary( | ||
name = "cloe_shell", | ||
srcs = ["cloe_shell.sh"], | ||
args = ["$(location //engine:cloe-engine)"] + ["$(location {})".format(p) for p in CLOE_PLUGINS], | ||
data = ["//engine:cloe-engine"] + CLOE_PLUGINS + glob(["tests/*"]), | ||
) |
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 @@ | ||
module(name = "cloe", version = "0.25.0") | ||
|
||
# Build dependencies: | ||
bazel_dep(name = "cmake_configure_file", version = "0.1.0") | ||
bazel_dep(name = "rules_cc", version = "0.0.9") | ||
|
||
# Test dependencies: | ||
bazel_dep(name = "googletest", version = "1.14.0", repo_name = "gtest") | ||
|
||
# Library dependencies: | ||
bazel_dep(name = "boost", version = "1.83.0.bcr.1") | ||
bazel_dep(name = "cli11", version = "2.3.2") | ||
bazel_dep(name = "eigen", version = "3.4.0.bcr.1") | ||
bazel_dep(name = "fmt", version = "10.2.1") | ||
bazel_dep(name = "incbin", version = "20211106.0") | ||
bazel_dep(name = "inja", version = "3.4.0") | ||
bazel_dep(name = "lua", version = "5.4.6") | ||
bazel_dep(name = "nlohmann_json", version = "3.11.3") | ||
bazel_dep(name = "oatpp", version = "1.3.0") | ||
bazel_dep(name = "sol", version = "3.3.1") | ||
bazel_dep(name = "spdlog", version = "1.13.0") | ||
bazel_dep(name = "open-simulation-interface", version = "3.5.0") | ||
bazel_dep(name = "protobuf", version = "26.0") | ||
|
||
# Tooling dependencies: | ||
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", # 2024-07-04 | ||
) |
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
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,18 @@ | ||
#!/bin/bash | ||
|
||
export CLOE_LOG_LEVEL=debug | ||
export CLOE_STRICT_MODE=1 | ||
export CLOE_ROOT="$(pwd)" | ||
export CLOE_ENGINE="${CLOE_ROOT}/$1" | ||
export CLOE_LUA_PATH="${CLOE_ROOT}/engine/lua" | ||
export PATH="$(dirname "$CLOE_ENGINE"):$PATH" | ||
|
||
# Set plugin paths | ||
shift 1 | ||
while [[ $# -ne 0 ]]; do | ||
CLOE_PLUGIN_PATH="${CLOE_ROOT}/$(dirname "$1"):$CLOE_PLUGIN_PATH" | ||
shift 1 | ||
done | ||
export CLOE_PLUGIN_PATH | ||
|
||
exec $SHELL |
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,65 @@ | ||
load("//:version.bzl", "PROJECT_VERSION") | ||
|
||
cc_library( | ||
name = "enginelib", | ||
hdrs = glob(["src/**/*.hpp"], exclude=["src/main*.hpp"]), | ||
srcs = glob( | ||
["src/**/*.cpp"], | ||
exclude=[ | ||
"src/main*.cpp", | ||
"src/**/*_test.cpp", | ||
"src/server_mock.cpp", | ||
] | ||
), | ||
data = glob(["lua/**"]), | ||
includes = ["src"], | ||
additional_compiler_inputs = glob(["webui/**"]), | ||
deps = [ | ||
"//engine/vendor/lrdb", | ||
"//engine/vendor/linenoise", | ||
"//stack", | ||
"//fable", | ||
"//runtime", | ||
"//models", | ||
"//oak", | ||
"@boost//:algorithm", | ||
"@boost//:conversion", | ||
"@boost//:optional", | ||
"@boost//:process", | ||
"@boost//:uuid", | ||
"@sol", | ||
], | ||
defines = [ | ||
"CLOE_ENGINE_VERSION=\\\"{}\\\"".format(PROJECT_VERSION), | ||
"CLOE_ENGINE_TIMESTAMP=\\\"unknown\\\"", | ||
"CLOE_ENGINE_WITH_SERVER=1", | ||
"CLOE_ENGINE_WITH_LRDB=1", | ||
"PROJECT_SOURCE_DIR=\\\"engine\\\"", | ||
], | ||
linkopts = [ | ||
"-lpthread", | ||
], | ||
) | ||
|
||
cc_test( | ||
name = "engine_test", | ||
srcs = glob(["src/**/*_test.cpp"]), | ||
defines = [ | ||
"CLOE_LUA_PATH=\\\"" + package_name() + "/lua\\\"", | ||
], | ||
deps = [ | ||
":enginelib", | ||
"@gtest//:gtest_main", | ||
], | ||
) | ||
|
||
cc_binary( | ||
name = "cloe-engine", | ||
srcs = glob(["src/main*.hpp", "src/main*.cpp"]), | ||
includes = ["src"], | ||
deps = [ | ||
":enginelib", | ||
"@cli11", | ||
], | ||
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,16 @@ | ||
cc_library( | ||
name = "linenoise", | ||
hdrs = ["linenoise.h"], | ||
srcs = ["linenoise.c"], | ||
includes = ["."], | ||
local_defines = [ | ||
"__STDC_WANT_LIB_EXT2__=1", | ||
], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
cc_test( | ||
name = "linenoise_example", | ||
srcs = ["example.c"], | ||
deps = [":linenoise"], | ||
) |
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 @@ | ||
cc_library( | ||
name = "lrdb", | ||
hdrs = glob(["include/**/*.hpp"]), | ||
includes = ["include"], | ||
defines = [ | ||
"LRDB_USE_BOOST_ASIO=1", | ||
], | ||
deps = [ | ||
":picojson", | ||
"@lua", | ||
"@boost//:asio", | ||
], | ||
linkopts = [ | ||
"-lpthread", | ||
], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
cc_library( | ||
name = "picojson", | ||
hdrs = ["third_party/picojson/picojson.h"], | ||
includes = ["third_party/picojson"], | ||
) |
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,38 @@ | ||
load( | ||
"@cmake_configure_file//:cmake_configure_file.bzl", | ||
"cmake_configure_file", | ||
) | ||
load("//:version.bzl", "PROJECT_VERSION", "PROJECT_VERSION_U32") | ||
|
||
cmake_configure_file( | ||
name = "fable_version_hpp", | ||
src = "src/fable/version.hpp.in", | ||
out = "include/fable/version.hpp", | ||
defines = [ | ||
"FABLE_VERSION={}".format(PROJECT_VERSION), | ||
"FABLE_VERSION_U32={}".format(PROJECT_VERSION_U32), | ||
] | ||
) | ||
|
||
cc_library( | ||
name = "fable", | ||
srcs = glob(["src/**/*.cpp"], exclude=["src/**/*_test.cpp"]), | ||
hdrs = glob(["include/**/*.hpp"]) + [":fable_version_hpp"], | ||
includes = [ "include" ], | ||
deps = [ | ||
"@fmt", | ||
"@nlohmann_json//:json", | ||
], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
cc_test( | ||
name = "fable_test", | ||
srcs = glob(["src/**/*_test.cpp"]), | ||
deps = [ | ||
":fable", | ||
"@sol", | ||
"@boost//:optional", | ||
"@gtest//:gtest_main", | ||
], | ||
) |
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 @@ | ||
filegroup( | ||
name = "inputs", | ||
srcs = [ | ||
"example_addressbook.json", | ||
"invalid_addressbook.json", | ||
] | ||
) | ||
|
||
cc_binary( | ||
name = "contacts", | ||
srcs = [ | ||
"src/main.cpp", | ||
], | ||
deps = [ | ||
"//fable", | ||
"@cli11", | ||
], | ||
data = [ | ||
":inputs", | ||
] | ||
) |
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,20 @@ | ||
filegroup( | ||
name = "inputs", | ||
srcs = [ | ||
"example_input.json", | ||
] | ||
) | ||
|
||
cc_binary( | ||
name = "simple_config", | ||
srcs = [ | ||
"src/main.cpp", | ||
], | ||
deps = [ | ||
"//fable", | ||
"@cli11", | ||
], | ||
data = [ | ||
":inputs", | ||
] | ||
) |
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 @@ | ||
cc_library( | ||
name = "models", | ||
hdrs = glob(["include/**/*.hpp"]), | ||
srcs = glob(["src/**/*.cpp"], exclude=["src/**/*_test.cpp"]), | ||
includes = [ "include" ], | ||
deps = [ | ||
"//runtime", | ||
"@boost//:optional", | ||
"@eigen", | ||
], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
cc_test( | ||
name = "models_test", | ||
srcs = glob(["src/**/*_test.cpp"]), | ||
deps = [ | ||
":models", | ||
"@gtest//:gtest_main", | ||
], | ||
) |
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,20 @@ | ||
cc_library( | ||
name = "oak", | ||
hdrs = glob(["include/**/*.hpp"]), | ||
srcs = glob(["src/**"], exclude=["src/**/*_test.cpp"]), | ||
includes = [ "include" ], | ||
deps = [ | ||
"//runtime", | ||
"@oatpp", | ||
], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
cc_test( | ||
name = "models_test", | ||
srcs = glob(["src/**/*_test.cpp", "src/**/*.hpp"]), | ||
deps = [ | ||
":oak", | ||
"@gtest//:gtest_main", | ||
], | ||
) |
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
Oops, something went wrong.