Skip to content

Commit

Permalink
Consider include directories of all dependencies recursively
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Haschke <[email protected]>
  • Loading branch information
rhaschke committed Sep 16, 2022
1 parent 796cef7 commit 3a9e660
Showing 1 changed file with 9 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,20 +127,16 @@ function(ament_target_dependencies target)
if(NOT ARG_INTERFACE)
target_compile_definitions(${target}
${required_keyword} ${definitions})
# the interface include dirs must be ordered
set(interface_include_dirs)
foreach(interface ${interfaces})
get_target_property(_include_dirs ${interface} INTERFACE_INCLUDE_DIRECTORIES)
if(_include_dirs)
list_append_unique(interface_include_dirs ${_include_dirs})
endif()
endforeach()
ament_include_directories_order(ordered_interface_include_dirs ${interface_include_dirs})
# the interface include dirs are used privately to ensure proper order
# and the interfaces cover the public case
target_include_directories(${target} ${system_keyword}
PRIVATE ${ordered_interface_include_dirs})
endif()

# fetch include directories of all transitive dependencies (already sorted)
ament_get_recursive_properties(interface_include_dirs_ordered _ ${interfaces})

# the interface include dirs are used privately - just to ensure proper ordering
# the interfaces cover the public case
target_include_directories(${target} ${system_keyword}
PRIVATE ${interface_include_dirs_ordered})

ament_include_directories_order(ordered_include_dirs ${include_dirs})
target_link_libraries(${target}
${optional_keyword} ${interfaces})
Expand Down

0 comments on commit 3a9e660

Please sign in to comment.