Skip to content

Shouldn't the node from rclcpp_components_register_node depend on the library? #2868

@peci1

Description

@peci1

I've just noticed the executable my_exec created by calling

rclcpp_components_register_node(my_lib PLUGIN "my::Lib" EXECUTABLE my_exec)

does not have CMake dependency on my_lib. That seems weird to me because when I rebuild the executable, CMake doesn't automatically trigger a rebuild of the library.

I know that purely technically the two do not directly depend on each other, but in any imaginable case, I think developers would want the lib to be rebuilt.

Adding this line fixes the problem:

  add_dependencies(my_exec my_lib)

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions