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

Use modern CMake method to add compile options #60

Open
wants to merge 1 commit into
base: ros2
Choose a base branch
from

Conversation

RoboticsYY
Copy link

This PR intends to use modern CMake method add_compile_options to add compile options and to align with ROS2 standard. Still use set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-redundant-decls"), because add_compile_options will not reach the targets generated from the rosidl.

@rhaschke
Copy link
Contributor

I don't see why add_compile_options doesn't affect rosidl. The link doesn't provide an explanation.

@RoboticsYY
Copy link
Author

I don't see why add_compile_options doesn't affect rosidl. The link doesn't provide an explanation.

My understanding is that add_compile_options only appends COMPILE_OPTIONS to the targets created by the followed add_library() or add_executable(). However, setting CMAKE_CXX_FLAGS can change the variables in the cmake cache file of the package's build directory. And this can affects the files in the build directory generated by rosidl.

For the redundant declarations of rosidl, I have filed up a issue here.

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

Successfully merging this pull request may close these issues.

2 participants