Skip to content

Commit

Permalink
Copy over runfiles library from Bazel
Browse files Browse the repository at this point in the history
The runfiles library can be maintained independently of Bazel releases and bazel_tools can refer to it via an alias.
  • Loading branch information
fmeum committed Oct 31, 2024
1 parent a5827bf commit 82e44f3
Show file tree
Hide file tree
Showing 8 changed files with 1,661 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
bazel-*
MODULE.bazel.lock
/.ijwb/
/.clwb/
1 change: 1 addition & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ use_repo(cc_configure, "local_config_cc", "local_config_cc_toolchains")

register_toolchains("@local_config_cc_toolchains//:all")

bazel_dep(name = "googletest", version = "1.15.2", dev_dependency = True)
bazel_dep(name = "rules_testing", version = "0.6.0", dev_dependency = True)
bazel_dep(name = "stardoc", version = "0.7.0", dev_dependency = True)
7 changes: 7 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,10 @@ http_archive(
strip_prefix = "rules_testing-0.6.0",
url = "https://github.com/bazelbuild/rules_testing/releases/download/v0.6.0/rules_testing-v0.6.0.tar.gz",
)

http_archive(
name = "googletest",
integrity = "sha256-e0K01u1IgQxTYsJloX+uvpDcI3PIheUhZDnTeSfwKSY=",
strip_prefix = "googletest-1.15.2",
url = "https://github.com/google/googletest/releases/download/v1.15.2/googletest-1.15.2.tar.gz",
)
11 changes: 9 additions & 2 deletions cc/runfiles/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
load("@rules_cc//cc:cc_library.bzl", "cc_library")

licenses(["notice"])

alias(
cc_library(
name = "runfiles",
actual = "@bazel_tools//tools/cpp/runfiles",
srcs = ["runfiles.cc"],
hdrs = ["runfiles.h"],
# Ensure that this header can be included from the same directory as the
# legacy @bazel_tools//tools/cpp/runfiles library.
include_prefix = "tools/cpp/runfiles",
strip_include_prefix = ".",
visibility = ["//visibility:public"],
)
Loading

0 comments on commit 82e44f3

Please sign in to comment.