Xcode10 beta3项目适配

作者: Gavin008 | 来源:发表于2018-07-14 19:15 被阅读30次

变化一:build system

Xcode10 beta3默认使用New Build System编译,这套编译会严格解析各个文件的依赖关系,如果编译不过,可以退回到Legacy Build System,方法如下

~~~

    Xcode -> File -> Workspace Settings || Project Settings

~~~

变化2:Xcode10 beta3已经移除c++6 和c++6.0.9

由于c++6和c++6.0.9被移除,如果依赖这两个库,工程项目会编译不过。解决方法就是将这两个库移除,添加libc++库。

如果是pod库依赖,需要将pod库的依赖‘stdc++.6’,'stdc++.6.0.9'换成'c++'即可。如果需要更改的比较多,可以先在pod file添加如下方法,快速修改

~~~

target.build_configurations.each do |config|

    if target.name == "Pods-YourTarget" 

    xcconfig_path = config.base_configuration_reference.real_path

    xcconfig = File.read(xcconfig_path)

    new_xcconfig = xcconfig.sub(' -l"stdc++.6"', '-l"c++"')

    File.open(xcconfig_path, "w") { |file| file << new_xcconfig }

    end

end

~~~

相关文章

网友评论

  • hnxyzhw:关于问题一build system的报错,我这边是重新执行pod install 就解决了。:flushed:
  • Hawthorn_:有用
  • 李美东:Xcode10 beta3已经移除c++6 和c++6.0.9 这个问题,在podfile文件中要添加的那段代码,写在什么位置??能发个demo吗,我试了 还是报错;是不是我写的有问题

本文标题:Xcode10 beta3项目适配

本文链接:https://www.haomeiwen.com/subject/gygypftx.html