Associate POD Spec attributes to different Build Settings from their Xcode Configuration (e.g. Release, Debug) Associate POD Spec attributes to different Build Settings from their Xcode Configuration (e.g. Release, Debug) xcode xcode

Associate POD Spec attributes to different Build Settings from their Xcode Configuration (e.g. Release, Debug)


Update

I was too quick to jump to this solution, and actually, this one does not work.

While Conditional Variable Assignment of xcconfig syntax does set a value conditionally for architecture and platform, it works differently for configuration.Due to this difference, this solution doesn't get along with CocoaPods' xcconfig inheritance mechanics.

OP of this SO question apparently, and also I, could not successfuly use Conditional Variable Assignment for configuration in podspec.


Using Conditional Variable Assignment of xcconfig syntax, you can achieve it:

s.pod_target_xcconfig = {    'GCC_PREPROCESSOR_DEFINITIONS[config=Debug]' => '-DDEBUG=1',    'GCC_PREPROCESSOR_DEFINITIONS[config=Release]' => '-DNDEBUG -DNS_BLOCK_ASSERTIONS'}

Yet, there is a small side effect, as mentioned in another SO question, where resulting build settings will be defined multiple times in Pod.xcconfig somehow.