Skip to content

Commit

Permalink
Order both, interface and other include directories together
Browse files Browse the repository at this point in the history
  • Loading branch information
rhaschke committed Sep 9, 2022
1 parent a4dc5b5 commit 728dab2
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,18 +130,21 @@ function(ament_target_dependencies target)
endif()

# fetch include directories of all transitive dependencies (already sorted)
ament_get_recursive_properties(interface_include_dirs_ordered _ ${interfaces})
ament_get_recursive_properties(interface_include_dirs _ ${interfaces})
# combine with include_dirs
list_append_unique(interface_include_dirs ${include_dirs})
ament_include_directories_order(ordered_include_dirs ${interface_include_dirs})

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

ament_include_directories_order(ordered_include_dirs ${include_dirs})
# the following statements cover transitive forwarding
target_link_libraries(${target}
${optional_keyword} ${interfaces})
target_include_directories(${target} ${system_keyword}
${required_keyword} ${ordered_include_dirs})
${required_keyword} ${include_dirs})

if(NOT ARG_INTERFACE)
ament_libraries_deduplicate(unique_libraries ${libraries})
target_link_libraries(${target}
Expand Down

0 comments on commit 728dab2

Please sign in to comment.