Skip to content

Commit

Permalink
Remove the last uses of ament_target_dependencies in this repo. (#102)
Browse files Browse the repository at this point in the history
While we are here, remove unnecessary exports of
dependencies to downstream packages.  With the one
exception of rcl_logging_interface, all of the packages
in here are implementation-only, so they should never
need to export dependencies downstream.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
  • Loading branch information
clalancette authored Aug 24, 2023
1 parent e9f237d commit 6d776cd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
5 changes: 2 additions & 3 deletions rcl_logging_interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ add_library(${PROJECT_NAME} ${${PROJECT_NAME}_sources})
target_include_directories(${PROJECT_NAME} PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>")
ament_target_dependencies(${PROJECT_NAME} rcutils)
target_link_libraries(${PROJECT_NAME} PUBLIC rcutils::rcutils)
target_compile_definitions(${PROJECT_NAME} PRIVATE "RCL_LOGGING_INTERFACE_BUILDING_DLL")

install(
Expand Down Expand Up @@ -54,8 +54,7 @@ if(BUILD_TESTING)
find_package(rcpputils REQUIRED)
ament_add_gtest(test_get_logging_directory test/test_get_logging_directory.cpp)
if(TARGET test_get_logging_directory)
target_link_libraries(test_get_logging_directory ${PROJECT_NAME})
ament_target_dependencies(test_get_logging_directory rcutils rcpputils)
target_link_libraries(test_get_logging_directory ${PROJECT_NAME} rcpputils::rcpputils rcutils::rcutils)
endif()
endif()

Expand Down
2 changes: 0 additions & 2 deletions rcl_logging_noop/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}
RUNTIME DESTINATION bin)


# Export rcl_logging_interface to give downstream packages access to it's headers
ament_export_dependencies(rcl_logging_interface)
ament_export_libraries(${PROJECT_NAME})
ament_export_targets(${PROJECT_NAME})
ament_package()
8 changes: 1 addition & 7 deletions rcl_logging_spdlog/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,15 @@ if(BUILD_TESTING)
find_package(ament_cmake_gtest REQUIRED)
ament_add_gmock(test_logging_interface test/test_logging_interface.cpp)
if(TARGET test_logging_interface)
target_link_libraries(test_logging_interface ${PROJECT_NAME})
target_link_libraries(test_logging_interface ${PROJECT_NAME} rcpputils::rcpputils)
target_compile_definitions(test_logging_interface PUBLIC RCUTILS_ENABLE_FAULT_INJECTION)
ament_target_dependencies(test_logging_interface rcpputils)
endif()
add_performance_test(benchmark_logging_interface test/benchmark/benchmark_logging_interface.cpp)
if(TARGET benchmark_logging_interface)
target_link_libraries(benchmark_logging_interface ${PROJECT_NAME})
endif()
endif()

ament_export_dependencies(rcl_logging_interface)
ament_export_dependencies(rcpputils)
ament_export_dependencies(rcutils)
ament_export_dependencies(spdlog_vendor)
ament_export_dependencies(spdlog)
ament_export_libraries(${PROJECT_NAME})
ament_export_targets(${PROJECT_NAME})
ament_package()

0 comments on commit 6d776cd

Please sign in to comment.