0

The setup is the same as in my other question here.

I thought a bit more about the problem, and it turns out, of all symbols exported from the libraries I'm using, I only need a few of them. In the specific example that was given, I just need the functions g() and h(). f() doesn't need to be exported at all.

So what I'm trying to do now is to hide all symbols in each static library, except for those I actually need (in the example: g() from liba.a and h() from libb.a). I found some solutions that I believe will work in Linux (such as -Wl,--exclude-libs=ALL), but as stated in the previous question, Linux is not the problem, macOS is, and the macOS linker doesn't recognize that flag.

Is there a (preferably cross-platform, CMake-supported) way to either specify an exhaustive list of symbols I'd like to import from a static library when linking, or a way to process the static library so as to hide symbols that are not needed?

swineone
  • 2,296
  • 1
  • 18
  • 32

0 Answers0