Skip to content

Use modern CMake method to add compile options - #60

Open
RoboticsYY wants to merge 1 commit into
moveit:ros2from
RoboticsYY:ros2
Open

Use modern CMake method to add compile options#60
RoboticsYY wants to merge 1 commit into
moveit:ros2from
RoboticsYY:ros2

Conversation

@RoboticsYY

Copy link
Copy Markdown

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
Copy Markdown
Contributor

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

@RoboticsYY

Copy link
Copy Markdown
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