Skip to content
Merged
Show file tree
Hide file tree
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
39 changes: 21 additions & 18 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,50 +6,50 @@ cc_shared_library(
#user_link_flags = [
# "-Wl,--no-undefined",
#],
deps = [
"//implementation",
],
deps = ["//implementation"],
)

cc_shared_library(
name = "vsomeip3_config_plugin",
dynamic_deps = [
":vsomeip3_shared",
],
dynamic_deps = [":vsomeip3_shared"],
shared_lib_name = "libvsomeip3-cfg.so.3",
tags = ["same-ros-pkg-as: vsomeip3"],
# Disabled due to linking problem when used as an external repository with sanitizers enabled.
#user_link_flags = [
# "-Wl,--no-undefined",
#],
deps = [
"//implementation:configuration",
],
deps = ["//implementation:configuration"],
)

cc_shared_library(
name = "vsomeip3_sd_plugin",
dynamic_deps = [
":vsomeip3_shared",
],
dynamic_deps = [":vsomeip3_shared"],
shared_lib_name = "libvsomeip3-sd.so.3",
tags = ["same-ros-pkg-as: vsomeip3"],
# Disabled due to linking problem when used as an external repository with sanitizers enabled.
#user_link_flags = [
# "-Wl,--no-undefined",
#],
deps = [
"//implementation:service_discovery",
],
deps = ["//implementation:service_discovery"],
)

cc_import(
name = "vsomeip3_import",
shared_library = ":vsomeip3_shared",
tags = ["same-ros-pkg-as: vsomeip3"],
deps = [
"//interface",
],
deps = ["//interface"],
)

cc_import(
name = "vsomeip3_configuration_plugin_import",
shared_library = ":vsomeip3_config_plugin",
tags = ["same-ros-pkg-as: vsomeip3"],
)

cc_import(
name = "vsomeip3_sd_plugin_import",
shared_library = ":vsomeip3_sd_plugin",
tags = ["same-ros-pkg-as: vsomeip3"],
)

# interface library, use this target to depend on vsomeip
Expand All @@ -67,5 +67,8 @@ cc_library(
visibility = ["//visibility:public"],
deps = [
":vsomeip3_import",
":vsomeip3_configuration_plugin_import",
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@evan-flynn-apexai just for documentation sake: Why the additional *_import targets? The libraries would already by built and added to the runfiles as part of data, isn't it? I guess I miss something :)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing the import targets cause Bazel to emit runpath entries for those plugins, such that dlopen succeeds without extra RPATH

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, makes sense - we can then approve and merge this @mziegler-apexai

":vsomeip3_sd_plugin_import",
"//interface",
],
)
14 changes: 2 additions & 12 deletions examples/hello_world/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@ cc_library(

cc_binary(
name = "hello_world_service",
srcs = [
"hello_world_service_main.cpp",
],
linkopts = [
"-Wl,-rpath=\\$$ORIGIN/../..,--disable-new-dtags",
],
srcs = ["hello_world_service_main.cpp"],
deps = [
":vsomeip_hello_world_service",
"//:vsomeip3",
Expand All @@ -26,12 +21,7 @@ cc_binary(

cc_binary(
name = "hello_world_client",
srcs = [
"hello_world_client_main.cpp",
],
linkopts = [
"-Wl,-rpath=\\$$ORIGIN/../..,--disable-new-dtags",
],
srcs = ["hello_world_client_main.cpp"],
deps = [
":vsomeip_hello_world_client",
"//:vsomeip3",
Expand Down
Loading