Skip to content

Commit 6ce97e3

Browse files
authored
feat(cli): benchmark subcommand (#254)
1 parent 2703411 commit 6ce97e3

File tree

6 files changed

+752
-3
lines changed

6 files changed

+752
-3
lines changed

bazel/copts.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
copts = select({
22
"@bazel_tools//tools/cpp:msvc": ["/std:c++20", "/Zc:preprocessor", "/permissive-"],
3-
"//conditions:default": ["-std=c++20", "-Werror"],
3+
"//conditions:default": ["-std=c++20", "-Werror", "-fexperimental-library"],
44
})

cli/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ cc_binary(
1515
copts = copts,
1616
stamp = 1,
1717
deps = [
18+
"//cli/commands:benchmark",
1819
"//cli/commands:codegen",
1920
"//cli/commands:command",
2021
"//cli/commands:config",

cli/cli.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
#include <unordered_map>
66
#include "cli/bazel_stamp_header.hh"
77

8-
#include "./commands/command.hh"
8+
#include "./commands/benchmark.hh"
99
#include "./commands/codegen.hh"
10+
#include "./commands/command.hh"
1011
#include "./commands/config.hh"
1112

1213
using namespace std::string_view_literals;
@@ -27,8 +28,9 @@ constexpr auto USAGE = R"(Ecsact SDK Command Line
2728
Usage:
2829
ecsact (--help | -h)
2930
ecsact (--version | -v)
30-
ecsact config ([<options>...] | --help)
31+
ecsact benchmark ([<options>...] | --help)
3132
ecsact codegen ([<options>...] | --help)
33+
ecsact config ([<options>...] | --help)
3234
)";
3335

3436
std::string colorize_logo() {
@@ -65,6 +67,7 @@ int main(int argc, char* argv[]) {
6567
using ecsact::cli::detail::command_fn_t;
6668

6769
const std::unordered_map<std::string, command_fn_t> commands{
70+
{"benchmark", &ecsact::cli::detail::benchmark_command},
6871
{"codegen", &ecsact::cli::detail::codegen_command},
6972
{"config", &ecsact::cli::detail::config_command},
7073
};

cli/commands/BUILD.bazel

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,25 @@ cc_library(
99
copts = copts,
1010
)
1111

12+
cc_library(
13+
name = "benchmark",
14+
srcs = ["benchmark.cc"],
15+
hdrs = ["benchmark.hh"],
16+
copts = copts,
17+
deps = [
18+
":command",
19+
"//executable_path",
20+
"@magic_enum",
21+
"@bazelregistry_docopt_cpp//:docopt",
22+
"@boost//libs/dll",
23+
"@ecsact_runtime//:core",
24+
"@ecsact_runtime//:async",
25+
"@ecsact_runtime//:serialize",
26+
"@ecsact_si_wasm//:ecsactsi_wasm",
27+
"@nlohmann_json//:json",
28+
],
29+
)
30+
1231
cc_library(
1332
name = "codegen",
1433
srcs = ["codegen.cc"],

0 commit comments

Comments
 (0)