mvukov / rules_ros

Build ROS (1) with Bazel
Apache License 2.0
21 stars 11 forks source link

Why "cc_ros_library" will generate .so and .a at the same time? And how can I choose one to pack? #12

Closed sunzhec2702 closed 3 months ago

sunzhec2702 commented 6 months ago

Hi Milan

This project is very nice and useful for ROS + bazel user.

But when I try to use it and learn it, I didn't get why "cc_ros_library" will generate .so and .a at the same time? And how can I choose one to pack?

Would you please give me a help on this?

Thanks

mvukov commented 6 months ago

Hi, cc_ros_library is a macro that wraps Bazel's native cc_library. When you build a library, then it creates .so and .a indeed; one typically doesn't build libs, but build executables and runs tests. But, when you build an executable then it doesn't build libraries, but links object files directly into an executable.

And how can I choose one to pack?

Can you elaborate on this one, please?