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

Compile definitions not exported through cmake #143

Open
oysstu opened this issue Nov 15, 2024 · 3 comments
Open

Compile definitions not exported through cmake #143

oysstu opened this issue Nov 15, 2024 · 3 comments

Comments

@oysstu
Copy link

oysstu commented Nov 15, 2024

add_compile_definitions(ROS1)

add_compile_definitions(ROS2)

add_compile_definitions(ROS2_VER_N250)

If you instead use target_compile_definitions(<target> PUBLIC <definition>), I believe these should be automatically exported and defined in other projects through ament.

@thomasemter
Copy link
Contributor

Hi @oysstu ,

thanks for the hint. I'm not sure why we would export these, though. They are just used internally as compiler directives.

@oysstu
Copy link
Author

oysstu commented Nov 15, 2024

They are exposed through the header files. In other words, to use ROSaicNode in a ROS2 executor using static composition (i.e., not through composable nodes), the rosaic_node.hpp header has to be included, which fails without these definitions.

There's probably more examples, but the abstraction/typedefs.hpp header is one of the headers that need ROS2_VER_N250 to be defined which is indirectly included by rosaic_node.hpp.

@thomasemter
Copy link
Contributor

Ah, thank you so much for the explanation. We will change it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants