-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Define BAZEL_CURRENT_REPOSITORY for runfiles library dependents
When a cc_* target directly depends on a target that advertises `RunfilesLibraryInfo`, `BAZEL_CURRENT_REPOSITORY` is added as a local define with value the canonical name of the repository containing the target.
- Loading branch information
Showing
9 changed files
with
115 additions
and
7 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
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
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
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
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 |
---|---|---|
@@ -1,8 +1,19 @@ | ||
# This package will host the C++ runfiles library when it's finally released. | ||
load(":cc_runfiles_library.bzl", "cc_runfiles_library") | ||
|
||
cc_library( | ||
cc_runfiles_library( | ||
name = "runfiles", | ||
exports = ":runfiles_impl", | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
cc_library( | ||
name = "runfiles_impl", | ||
srcs = ["runfiles.cc"], | ||
hdrs = ["runfiles.h"], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
filegroup( | ||
name = "bzl_srcs", | ||
srcs = glob(["*.bzl"]), | ||
visibility = ["//tools/cpp:__pkg__"], | ||
) |
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 @@ | ||
def _cc_runfiles_library_impl(ctx): | ||
return [ | ||
ctx.attr.exports[DefaultInfo], | ||
ctx.attr.exports[CcInfo], | ||
RunfilesLibraryInfo(), | ||
] | ||
|
||
cc_runfiles_library = rule( | ||
implementation = _cc_runfiles_library_impl, | ||
attrs = { | ||
"exports": attr.label(), | ||
}, | ||
) |