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

Fix compilation for newer clang #175

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

Conversation

Tobias-Fischer
Copy link

No description provided.

@mintar
Copy link
Collaborator

mintar commented Jan 23, 2023

Thanks for your PR!

The pre-commit check in the CI is currently failing (see above). You can reproduce this locally by following the pre-commit instructions in the README. I've run catkin_lint with the additional --explain flag locally:

$ catkin_lint --explain rviz_imu_plugin/
rviz_imu_plugin: CMakeLists.txt(16): warning: variable CMAKE_CXX_FLAGS is modified
     * You have appended extra data to a critical CMake variable. This
     * might break the build on different systems or affect the global
     * catkin workspace in unintended ways.
     * You can ignore this problem with --ignore critical_var_append
rviz_imu_plugin: CMakeLists.txt(17): warning: variable CMAKE_C_FLAGS is modified
catkin_lint: checked 1 packages and found 2 problems
catkin_lint: option -W2 will show 5 additional notices

I believe the way to fix this is to use add_compile_options or even better target_compile_options instead of SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} [...] and SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} [...]. Could you try this?

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