Shared objects of target dependencies

32 views
Skip to first unread message

Luca Grementieri

unread,
May 11, 2022, 11:03:52 AM5/11/22
to bazel-discuss
Hi everyone,

I'm trying to build a shared object .so using Bazel.
The target is a cc_library and using `bazel build <target>`, I can successfully recover the shared object.

My problem arises when I try to use the shared object in another library (built with CMake). Since the target has many dependencies the linker cannot find all the symbols in the .so and the linking phase fails.
I'm trying to recursively built all the missing dependencies with Bazel adding explicitly the targets of dependencies to the command `bazel build`.

This manual work is very long, pedantic and wasteful since Bazel is already capable to resolve dependencies automatically and probably it builds internally all the needed shared objects.

Could you please tell me if there is a way to recover the .so files of the dependencies of a target built with Bazel?

Thank you in advance for your help.

Kind regards,
Luca Grementieri
Reply all
Reply to author
Forward
0 new messages