iOS组件化bugs工程架构

使用pod的方式启用bitcode

2017-10-12  本文已影响218人  mayudong1

将以下内容加入到podfile中,即可将pod方式管理的工程设置开启bitcode,防止出现不完全支持bitcode的现象

#bitcode enable
post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'YES'

      if config.name == 'Release'
          config.build_settings['BITCODE_GENERATION_MODE'] = 'bitcode'
      else
          config.build_settings['BITCODE_GENERATION_MODE'] = 'marker'
      end

      cflags = config.build_settings['OTHER_CFLAGS'] || ['$(inherited)']

      if config.name == 'Release'
          cflags << '-fembed-bitcode'
      else
          cflags << '-fembed-bitcode-marker'
      end

      config.build_settings['OTHER_CFLAGS'] = cflags
    end
  end
end
上一篇下一篇

猜你喜欢

热点阅读