ros2 / rmw_dds_common

Apache License 2.0
11 stars 20 forks source link

build shared lib only if BUILD_SHARED_LIBS is set #62

Closed hannes09 closed 2 years ago

hannes09 commented 2 years ago

Signed-off-by: Hannes Harms h.harms@grimme.de

methylDragon commented 2 years ago

Hiya! Could I check for the reason for why you'd like to no longer be forcing SHARED library builds?

hannes09 commented 2 years ago

The change is rquired to build ROS2 as a static set of librarys using the standart cmake feature BUILD_SHARED_LIBS=off With this change I can link rmw_dds_common as a static lib and run ros2 applications without a ROS2 installation.

s. https://github.com/ros2/ros2/issues/468

methylDragon commented 2 years ago

Got it! There's some internal discussion about this, and we can change it, though it'll necessitate some changes in upstream ROS libraries, so it might take a little while to resolve.

methylDragon commented 2 years ago

Hi there! With the merge of https://github.com/ament/ament_cmake/pull/390 , we can now merge this, with one change.

Could you help to add this line here, please? Once you do I'll launch CI and work towards getting this merged!

find_package(ament_cmake REQUIRED)
find_package(rcpputils REQUIRED)
find_package(rcutils REQUIRED)
find_package(rmw REQUIRED)
find_package(rosidl_default_generators REQUIRED)

ament_add_default_options() <<<--- THIS ONE! ⭐
ament_export_dependencies(ament_cmake_core)
ament_export_dependencies(rcpputils)
ament_export_dependencies(rcutils)
ament_export_dependencies(rmw)
methylDragon commented 2 years ago

Bumping @hannes09

hannes09 commented 2 years ago

I have added ament_add_default_options, but now the build fails.

clalancette commented 2 years ago

We need to do a release of ament_cmake. I'll get to that a little later today.

clalancette commented 2 years ago

@ros-pull-request-builder retest this please

methylDragon commented 2 years ago

I forgot ci.. my bad