Details
-
Bug
-
Status: Open
-
Critical
-
Resolution: Unresolved
-
None
-
None
-
None
Description
The preprocessor macro DEBUG=1 defined in build-debug.xcconfig is overridden by Pods-[project name].debug.xcconfig when the project uses CocoaPods.
In a standard Cordova project build-debug.xcconfig defines the preprocessor macro DEBUG=1 as follows:
GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1
The phonegap-plugin-push, for example, override the GCC_PREPROCESSOR_DEFINITIONS with:
```
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 $(inherited)
GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1 $(inherited) PB_FIELD_32BIT=1
PB_NO_PACKED_STRUCTS=1
```
This issue can exist with other plugins that use CocoaPods.
Reproduce Steps
```
$ cordova create test
$ cd test
$ cordova platform add ios
$ cordova plugin add phonegap-plugin-push
```
The $(inherited) does not work when xcconfig file includes other xcconfig files.
See https://github.com/CocoaPods/CocoaPods/issues/5785 .
As a result, the following code does not work in the debug build application.
```
#ifdef DEBUG
NSLog(@"debug step 1");
#endif
```
Note that this issue will be improved in Xcode 10 in which the function of $(inherited) is improved.
See also https://stackoverflow.com/questions/1393987/how-to-append-values-in-xcconfig-variables