2 years ago

#77297

test-img

Roman Byshko

How to link dynamically only with some libraries with bazel?

There are certain libraries, like gflags that have global state. I'm in a situation where main executable and dynamically loaded plugin (.so) both use gflags. In both cases bazel will link gflags statically. I need to change this, I somehow must tell bazel to link gflags only dynamically. I guess I could set linkstatic=Falsefor the main executable and the plugin (.so). But after that all other libraries will be also linked dynamically against them.

So my question is: how can I tell bazel to link only gflags dynamically?

bazel

bazel-cpp

0 Answers

Your Answer

Accepted video resources