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

Mark include directories as system directories #1171

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

Conversation

kunaltyagi
Copy link

Allows use of warning flags without the compiler complaining about gtest/gmock related issues

Allows use of warning flags without the compiler complaining about gtest/gmock related issues
@gbiggs
Copy link
Contributor

gbiggs commented Jun 22, 2022

Can you please provide some sample output of before and after this change that demonstrates what effect it has?

@kunaltyagi
Copy link
Author

kunaltyagi commented Jun 23, 2022

Haven't seen this issue with catkin build, but with colcon build.

I've seen two difference between their behaviors:

  • catkin created an imported target for gtest/gmock etc, while colcon creates a new target per package with the tests
  • warnings (via compiler flags) are propagated across include <header > for colcon, but not catkin

I don't know if these 2 are related, but adding SYSTEM seems to have stopped the warnings for me

@ivanpauno
Copy link
Collaborator

We have avoided using SYSTEM in the past as it has some unexpected side effects, see for example ament/ament_cmake#321 (comment).

@kunaltyagi
Copy link
Author

Reading that chain, towards the end, after investigation, they have accepted that this makes sense for ament.

I don't feel there would be any unexpected side-effects (as pointed out later):

  • We can't control what flags are used by users
  • Errors/Warnings in gtest shouldn't affect user code unless someone has that in the same overlay
  • Later inclusions on both -I and -isystem override the earlier ones (left to right). This allows proper usage with overlays

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.

3 participants