Skip to content

Commit

Permalink
[workspace] Generalize vendor_cxx for multiple uses (RobotLocomotion#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jwnimmer-tri authored and aykut-tri committed May 27, 2022
1 parent 222c5e5 commit 05d66f6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
9 changes: 9 additions & 0 deletions tools/workspace/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ drake_py_binary(
],
)

drake_py_binary(
name = "vendor_cxx",
srcs = ["vendor_cxx.py"],
visibility = [
"@yaml_cpp_internal//:__pkg__",
],
deps = [":module_py"],
)

drake_py_binary(
name = "cmake_configure_file",
srcs = ["cmake_configure_file.py"],
Expand Down
File renamed without changes.
10 changes: 0 additions & 10 deletions tools/workspace/yaml_cpp_internal/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
# -*- python -*-

load(
"@drake//tools/skylark:drake_py.bzl",
"drake_py_binary",
)
load("//tools/lint:lint.bzl", "add_lint_tests")

drake_py_binary(
name = "vendor_cxx",
srcs = ["vendor_cxx.py"],
visibility = ["@yaml_cpp_internal//:__pkg__"],
)

add_lint_tests()
6 changes: 3 additions & 3 deletions tools/workspace/yaml_cpp_internal/package.BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ _VENDORED_SRCS = [
]

genrule(
name = "foo",
name = "vendoring",
srcs = _HDRS + _SRCS,
outs = _VENDORED_HDRS + _VENDORED_SRCS,
cmd = " ".join([
"$(execpath @drake//tools/workspace/yaml_cpp_internal:vendor_cxx)",
"$(execpath @drake//tools/workspace:vendor_cxx)",
"--edit-include=yaml-cpp/:drake-yaml-cpp/",
] + [
"$(execpath {}):$(execpath {})".format(old, new)
for old, new in zip(_HDRS, _VENDORED_HDRS) + zip(_SRCS, _VENDORED_SRCS)
]),
tools = ["@drake//tools/workspace/yaml_cpp_internal:vendor_cxx"],
tools = ["@drake//tools/workspace:vendor_cxx"],
)

cc_library(
Expand Down

0 comments on commit 05d66f6

Please sign in to comment.