Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support extra_deps arg for rosidl both cc and py #345

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions bazel_ros2_rules/ros2/rosidl.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1138,6 +1138,7 @@ def rosidl_cc_support(
interfaces,
data,
deps,
extra_deps,
group = None,
cc_binary_rule = native.cc_binary,
cc_library_rule = native.cc_library,
Expand Down Expand Up @@ -1165,7 +1166,7 @@ def rosidl_cc_support(
group = group or name,
interfaces = interfaces,
includes = [_make_public_label(dep, "_defs") for dep in deps],
deps = [_make_public_label(dep, "_cc") for dep in deps],
deps = [_make_public_label(dep, "_cc") for dep in deps] + extra_deps,
cc_library_rule = cc_library_rule,
**kwargs
)
Expand All @@ -1188,7 +1189,7 @@ def rosidl_cc_support(
deps = [_make_private_label(name, "__rosidl_cpp")] + [
_make_public_label(dep, "_cc")
for dep in deps
],
] + extra_deps,
cc_binary_rule = cc_binary_rule,
cc_library_rule = cc_library_rule,
**kwargs
Expand Down Expand Up @@ -1222,7 +1223,7 @@ def rosidl_cc_support(
deps = [_make_private_label(name, "__rosidl_cpp")] + [
_make_public_label(dep, "_cc")
for dep in deps
],
] + extra_deps,
cc_binary_rule = cc_binary_rule,
cc_library_rule = cc_library_rule,
**kwargs
Expand Down Expand Up @@ -1253,7 +1254,7 @@ def rosidl_cc_support(
deps = [_make_private_label(name, "__rosidl_cpp")] + [
_make_public_label(dep, "_cc")
for dep in deps
],
] + extra_deps,
cc_binary_rule = cc_binary_rule,
**kwargs
)
Expand All @@ -1278,7 +1279,7 @@ def rosidl_cc_support(
_make_public_label(name, "__rosidl_typesupport_cpp"),
] + typesupports.values(),
data = data,
deps = [_make_private_label(name, "__rosidl_cpp")],
deps = [_make_private_label(name, "__rosidl_cpp")] + extra_deps,
linkstatic = True,
**kwargs
)
Expand All @@ -1288,6 +1289,7 @@ def rosidl_py_support(
interfaces,
data,
deps,
extra_deps,
group = None,
cc_binary_rule = native.cc_binary,
cc_library_rule = native.cc_library,
Expand Down Expand Up @@ -1317,7 +1319,7 @@ def rosidl_py_support(
group = group or name,
interfaces = interfaces,
includes = [_make_public_label(dep, "_defs") for dep in deps],
deps = [_make_public_label(dep, "_c") for dep in deps],
deps = [_make_public_label(dep, "_c") for dep in deps] + extra_deps,
cc_library_rule = cc_library_rule,
**kwargs
)
Expand All @@ -1340,7 +1342,7 @@ def rosidl_py_support(
deps = [_make_private_label(name, "__rosidl_c")] + [
_make_public_label(dep, "_c")
for dep in deps
],
] + extra_deps,
cc_binary_rule = cc_binary_rule,
cc_library_rule = cc_library_rule,
**kwargs
Expand Down Expand Up @@ -1374,7 +1376,7 @@ def rosidl_py_support(
deps = [_make_private_label(name, "__rosidl_c")] + [
_make_public_label(dep, "_c")
for dep in deps
],
] + extra_deps,
cc_binary_rule = cc_binary_rule,
cc_library_rule = cc_library_rule,
**kwargs
Expand Down Expand Up @@ -1405,7 +1407,7 @@ def rosidl_py_support(
deps = [_make_private_label(name, "__rosidl_c")] + [
_make_public_label(dep, "_c")
for dep in deps
],
] + extra_deps,
cc_binary_rule = cc_binary_rule,
**kwargs
)
Expand All @@ -1431,7 +1433,7 @@ def rosidl_py_support(
srcs = typesupports.values(),
deps = [
_make_private_label(name, "__rosidl_c"),
] + typesupports.values(),
] + typesupports.values() + extra_deps,
linkstatic = True,
**kwargs
)
Expand All @@ -1447,7 +1449,7 @@ def rosidl_py_support(
c_deps = [_make_public_label(name, "_c")] + [
_make_public_label(dep, "_c")
for dep in deps
],
] + extra_deps,
cc_binary_rule = cc_binary_rule,
cc_library_rule = cc_library_rule,
py_library_rule = py_library_rule,
Expand All @@ -1459,6 +1461,7 @@ def rosidl_interfaces_group(
interfaces,
data = [],
deps = [],
extra_deps = [],
group = None,
cc_binary_rule = native.cc_binary,
cc_library_rule = native.cc_library,
Expand Down Expand Up @@ -1515,6 +1518,7 @@ def rosidl_interfaces_group(
interfaces = interfaces,
data = data,
deps = deps,
extra_deps = extra_deps,
group = group,
cc_binary_rule = cc_binary_rule,
cc_library_rule = cc_library_rule,
Expand All @@ -1528,6 +1532,7 @@ def rosidl_interfaces_group(
# Add the C++ target so that we can support `ros2 bag record`.
data = data + [cc_name],
deps = deps,
extra_deps = extra_deps,
group = group,
cc_binary_rule = cc_binary_rule,
cc_library_rule = cc_library_rule,
Expand Down