Skip to content

Commit

Permalink
build: exclude ROS2 specific files from the build if not using ROS2
Browse files Browse the repository at this point in the history
Remove ROS2-related source files from the compilation when the project is configured without ROS2 support, helping to streamline the build process and avoid unnecessary dependencies.
  • Loading branch information
zhangyi1357 committed Nov 19, 2024
1 parent f341fc0 commit a5cea2c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/runtime/python_runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ set(CUR_TARGET_ALIAS_NAME ${CUR_SUPERIOR_NAMESPACE}::${CUR_DIR})
# Set file collection
file(GLOB_RECURSE src CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.cc)
file(GLOB_RECURSE py_files CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.py)
file(GLOB_RECURSE ros2_files CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/ros2_type_support_utils.cc)

if (NOT AIMRT_BUILD_WITH_ROS2)
list(REMOVE_ITEM src ${ros2_files})
endif()

# Add target
pybind11_add_module(${CUR_TARGET_NAME} SHARED)
Expand Down

0 comments on commit a5cea2c

Please sign in to comment.