I have a project tree in Xcode that looks like this: AppProject depends on ObjcWrapper which in turn depends on PureCppLib. ObjcWrapper and PureCppLib are static library projects. Combined, all sources barely reach 15k lines of code, and, as expected, the size of resulting binary is about 750Kb in release mode and slightly over 1Mb in debug mode. So far, so good.
However, ObjcWraper.a and PureCppLib.a are over 6Mb each in either mode. So the first question is why it is so. But more importantly, how can I ensure that those static libs do not include parts or all of the source code?
Thanks in advance!
Static library - a unit of code linked at compile time, which does not change.
Question: Can we create static frameworks using Swift? Answer: Finally, YES! (Xcode 9). CocoaPods announced the support of Swift Static Frameworks in 1.5.
A static library is a file, stored in object code, used to store functions, variables, classes etc… that you may want to use when building a new program.
If you are looking at a binary library / framework (perhaps it's precompiled by a 3rd party) and want to know if it's a static or dynamic binary, just use file command with the path to the binary file. Example (static framework) - static binaries are usually marked with ar archive or similar.
You probably want to build your static library without debug symbols. Find the "Generate Debug Symbols" build setting for the static library target in the Configuration you distribute, and make sure it is unchecked.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With