Fix unknown macro errors reported by cppcheck 1.90 (#1000)

It was complaining about an unknown macro RCLCPP_SMART_PTR_DEFINITIONS.
Passing rclcpp include directories to cppcheck resolves the errors
reported in rclcpp_action and rclcpp_lifecycle.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
This commit is contained in:
Jacob Perron 2020-03-04 09:05:21 -08:00 committed by GitHub
parent d48d4608e5
commit e3949cb5ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View file

@ -65,6 +65,8 @@ ament_export_dependencies(rosidl_generator_c)
if(BUILD_TESTING)
find_package(ament_cmake_gtest REQUIRED)
find_package(ament_lint_auto REQUIRED)
# Give cppcheck hints about macro definitions coming from outside this package
set(ament_cmake_cppcheck_ADDITIONAL_INCLUDE_DIRS ${rclcpp_INCLUDE_DIRS})
ament_lint_auto_find_test_dependencies()
ament_add_gtest(test_client test/test_client.cpp TIMEOUT 120)