Skip to content

Commit

Permalink
deps: Add nanobench
Browse files Browse the repository at this point in the history
  • Loading branch information
robinlinden committed Jan 5, 2025
1 parent 63cf259 commit 4d512e3
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
19 changes: 19 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,25 @@ EOF""",
url = "https://github.com/SFML/imgui-sfml/archive/4fec0d0f35f10f58b327cf5b4d12852ed1a77fbb.tar.gz",
)

# https://github.com/martinus/nanobench
bazel_dep(name = "nanobench") # MIT
archive_override(
module_name = "nanobench",
build_file = "//third_party:nanobench.BUILD",
integrity = "sha256-U6WpE/ppXCNUZmG/LNIrKZ4Qo+mU2e2X2vibXK2g2nA=",
patch_cmds = [
"""cat <<EOF >MODULE.bazel
module(name = "nanobench")
bazel_dep(name = "rules_cc")
EOF""",
# nanobench's use of std::locale segfaults w/ -fno-rtti in combination w/ libstdc++.
# See: https://github.com/martinus/nanobench/issues/122
"sed -i'' -e /std::locale\\(/d src/include/nanobench.h",
],
strip_prefix = "nanobench-4.3.11",
url = "https://github.com/martinus/nanobench/archive/refs/tags/v4.3.11.tar.gz",
)

# https://github.com/simdjson/simdjson
bazel_dep(name = "simdjson")
archive_override(
Expand Down
9 changes: 9 additions & 0 deletions third_party/nanobench.BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
load("@rules_cc//cc:defs.bzl", "cc_library")

cc_library(
name = "nanobench",
hdrs = ["src/include/nanobench.h"],
defines = ["ANKERL_NANOBENCH_IMPLEMENT"],
strip_include_prefix = "src/include",
visibility = ["//visibility:public"],
)

0 comments on commit 4d512e3

Please sign in to comment.