I have an XCode workspace managed by Cocoapod
with a few dependencies to external libraries. One of them, MTDates, extends NSDate
and NSDateComponents
with either prefixed methods, or non-prefixed if a certain preprocessor macro is defined (which is what I want).
There are a few places where I can put the preprocessor macro definition in order to have the compiled library provide the non-prefixed methods, but all seem to be reset as soon as I ask Cocoapod
to update the project, which leads me to think that these configs are driven by the pod spec. These include :
.xcconfig
file in Cocoapod's Targets Support Files
Changing the pod's spec would require to manage my own version of the library, whereby losing the ability for cocoapods
to update it when a new version comes around. So my question is: is there a way to specify a preprocessor macro for a cocoapod
dependency, without forking the pod and changing the pod's spec itself?
Edit:
There is an open issue about this, that seem to be just around the corner.
as you mentioned 'The pod's private .xcconfig file in Cocoapod's Targets Support Files', i do this resolved my problem.
s.xcconfig = {'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) COCOAPODS=1 IOS=1' }
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