3

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?

Roman Byshko
  • 8,591
  • 7
  • 35
  • 57
  • Not sure if this will work, and don't have the time to explore. But have you tried creating a proxy target e.g. "//:gflags" that depends on the external target but has linkstatic = False ? – silvergasp Feb 01 '22 at 07:18

0 Answers0