I’m trying to condtionally link in. .a static libraries by defines. Is this possible in xcode?
Basically trying to wrap library specific code in ifdefs so it can be excluded at compile time by setting flags.
I’m trying to condtionally link in. .a static libraries by defines. Is this possible
Share
No, a C
#defineis not at the same level as library linkage.However, you can set a C
#define(via the Preprocessor Macros build setting) from the value of a custom build setting, likeBUILT_WITH_FOO, and also set yourOTHER_LDFLAGSbuild setting based on that custom build setting as well.For example:
The above would let you adjust only the value of the
BUILT_WITH_FOObuild setting to choose whether to use the Preprocessor Macros and Other Linker Flags variants whose names end with a trailing_, or the ones whose names end with a trailing_foo.