My apps consume two related static libraries from a 3rd party vendor. These libraries presumably share a lot of base functionality, which is understandable since they almost do the same thing, but in two different flavors. However, when I link in both of these static libs, Xcode’s linker will give tons of these warnings on the embedded object files:
same member name (xyz.o) in output file used for input files: /path/libA.a (xyz.o) and: /path/libB.a (xyz.o) due to use of basename, truncation and blank padding
Problem is thus that I have no control over these static libs, so I can’t fix it at the root. The only option I have is to suppress this specific warning for these specific static libs.
Since I’m almost finished removing all warnings from this project, I’d really like to squash these too. On Windows / Visual Studio I already isolated the problem by having a single static lib of myself which is used to combine these vendor libs, and link in that combined static lib in all my apps. This concentrates the warnings to that one helper static lib project, and there I pass /ignore:4006
to the linker.
I now want to do the same for Xcode, but I cannot for the life of me figure this one out… It seems Xcode’s setting “Warning Linker Flags” is ignored, and I should use “Other Linker Flags”? But passing in -w
or -Xlinker -w
doesn’t do anything. I myself use Xcode 12.3 (though other team members have more recent Xcode versions), and the code base is a combined C++ and Objective C one. Plus that these warnings appear for both the proxy static lib combining the two vendor libs, but then again when I link my proxy static lib into it’s final destination?