DEBUG preprocessor macro not defined for CocoaPods targets

后端 未结 5 893
灰色年华
灰色年华 2020-12-29 07:01

I\'m having issues with a pod called DCIntrospect-ARC which should only work in DEBUG mode. It checks if the DEBUG macro is defined before running. However, it is not define

5条回答
  •  佛祖请我去吃肉
    2020-12-29 07:36

    Even easier: just ensure you have the DEBUG=1 macro to your GCC_PREPROCESSOR_DEFINITIONS in your project in xCode for debug mode but not release mode. If you add it the the project level (not specific targets) it will be inherited by all targets (debug-test, custom targets, etc). This is set by default on new projects, and generally expected to be there. If you are missing it, that could have broad impact.

    If it's still not working, ensure you also have $(inherited) in all your targets for GCC_PREPROCESSOR_DEFINITIONS. CocoaPods and DEBUG both count on that.

提交回复
热议问题