DEBUG preprocessor macro not defined for CocoaPods targets

后端 未结 5 895
灰色年华
灰色年华 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:33

    you can use the post_install hook in Podfile.

    This hook allows you to make any last changes to the generated Xcode project before it is written to disk, or any other tasks you might want to perform. http://guides.cocoapods.org/syntax/podfile.html#post_install

    post_install do |installer_representation|
        installer_representation.pods_project.targets.each do |target|
            target.build_configurations.each do |config|
                if config.name != 'Release'
                    config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', 'DEBUG=1']
                end
            end
        end
    end
    

提交回复
热议问题