I want to link a static library ( .a file) with my code with some limitations
- The condition must be an environment variable instead of an assembly type (Debug, Release) or architecture.
- If the static library is not used (not imported, not used in the code), then the final binary file should not contain any links to it.
The code should look like this:
#ifdef CRASH_LOGGING [Crittercism enableWithAppID:@"abc"] #endif
And the environment variable should have a similar name.
I played with OTHER_LINKER_FLAGS = -weak_library , removing .a from the target, setting it as optional, but I can't get it to work. Either the library is not connected, I get a compilation error, or the .a part belongs to the final executable.
How can i achieve this?
source share