I'm developing a cross-platform static C++ library and am wondering if there are any build flags for reducing the size of the final MyLib.lib and libMyLib.a files on each platform (iOS, Android, Windows)?
I understand that every single dependency gets pulled into the build process and this is where my file size is coming from.
Why is my static library so huge?
But shouldn't there be some way to have the Linker/Librarian remove code from MyLib based on dependency calls actually made rather than theoretically possible?
The Linker does this when building the final .EXEcutable, but it seems the same rules could apply at the library linking level.
Overall this is a big problem for me because my cross-platform library is around 500MB for Windows and around 200MB on iOS. Oddly, Android is a reasonable 3.5MB.