Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(behavior_velocity_planner): export scene module libraries for faster build #1722

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 33 additions & 6 deletions planning/behavior_velocity_planner/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,53 @@ set(scene_modules
run_out
)

# for utilization. this comes first
ament_auto_add_library(behavior_velocity_planner_utilitzation SHARED
src/utilization/path_utilization.cpp
src/utilization/util.cpp
)
target_include_directories(behavior_velocity_planner_utilitzation
SYSTEM PUBLIC
${BOOST_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
${tf2_geometry_msgs_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIR}
)

# for each scene module export different library
macro(add_scene_module_library scene_module)
file(GLOB_RECURSE ${scene_module}_srcs "src/scene_module/${scene_module}/*")
ament_auto_add_library(behavior_velocity_planner_${scene_module} SHARED ${${scene_module}_srcs})
target_link_libraries(behavior_velocity_planner_${scene_module} behavior_velocity_planner_utilitzation)
target_include_directories(behavior_velocity_planner_${scene_module}
SYSTEM PUBLIC
${BOOST_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
${tf2_geometry_msgs_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIR}
)
endmacro()

foreach(scene_module IN LISTS scene_modules)
file(GLOB_RECURSE scene_module_src "src/scene_module/${scene_module}/*")
list(APPEND scene_modules_src ${scene_module_src})
add_scene_module_library(${scene_module})
endforeach()

# main node
ament_auto_add_library(behavior_velocity_planner SHARED
src/node.cpp
src/planner_manager.cpp
src/utilization/path_utilization.cpp
src/utilization/util.cpp
${scene_modules_src}
)

target_include_directories(behavior_velocity_planner
SYSTEM PUBLIC
${BOOST_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
${tf2_geometry_msgs_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIR}
)
# link each scene_module
foreach(scene_module IN LISTS scene_modules)
target_link_libraries(behavior_velocity_planner behavior_velocity_planner_${scene_module})
endforeach()

ament_target_dependencies(behavior_velocity_planner
Boost
Expand Down