ros / catkin

A CMake-based build system that is used to build all packages in ROS.
http://wiki.ros.org/catkin
BSD 3-Clause "New" or "Revised" License
321 stars 280 forks source link

gtest includes should not emit warnings #1133

Open stertingen opened 3 years ago

stertingen commented 3 years ago

When having some compiler warnings enabled, building tests may lead to very verbose compiling. This could be resolved by including the gtest headers as system includes.

The relevant part is here: https://github.com/ros/catkin/blob/noetic-devel/cmake/test/gtest.cmake#L178

The line should be (I think):

  # create the executable, with basic + gtest/gmock build flags
  include_directories(SYSTEM ${${type_upper}_INCLUDE_DIRS})
  link_directories(${${type_upper}_LIBRARY_DIRS})

Lots of warnings are emitted on Melodic, so if this is going to be fixed, I'd love to see a backport.