I've a project with several targets. There is a xcconfig file associated to the project and several xcconfig files associated to the targets.
Now I want to incorporate a third party library via CocoaPods. After $ pod install
CocoaPods screwed the original project since it associates its own xcconfig file Pds.xcconfig
to the target of the original project. This completely ignores and overwrites the settings defined in the original xcconfig associated to the project, and switched out the original xcconfig file associated to the target(s). Hence, the project ended up screwed.
For example, Cocoapods defines the following in its Pods.xcconfig
which is associated to each target:
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
I have different configs for each configuration, for example for Debug the config file osx.debug.xcconfig
defines
GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1 DEBUG_LOG=2 __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES=0
What's a reasonable and viable approach to solve such conflicts?
Edit:
I've searched through the CocoaPods issues list on GitHub. There seems to be a large number of issues related to xcconfig files, some of them more than 2 years old. They are discussed, and then closed, but - as it occurred to me - the issue has not yet been solved.
IMHO, this is a fundamental and a basic problem: there is a project which uses xcconfig files. Then, one wants to include a third party library via CocoaPods. After executing pod install
, the project is screwed up.
So, what's up with this?
HEADER_SEARCH_PATHS = $(HEADER_SEARCH_PATHS) MyOtherIncludes
. In order to make that work would probably break the current behavior how Xcode's xcconfig file settings modify the underlying build settings. – Blasted