美文网首页
iOS 加速编译 ccache 初使用

iOS 加速编译 ccache 初使用

作者: 十一岁的加重 | 来源:发表于2017-10-31 22:53 被阅读45次

参考文章,
http://www.php361.com/index.php?c=index&a=view&id=7432
实际操作
一、放第一个脚本

image.png

二、第二个脚本 其实一样的跟第一个

image.png

三、加入CC,貌似原文没有说明得加.sh,我这里是加上了的,并且包含C++,所以是$(SRCROOT)/ccache-clang++.sh

image.png

四、Module为NO

image.png

五、podfile文件中加入


post_install do |installer_representation|
    installer_representation.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            #关闭 Enable Modules
            config.build_settings['CLANG_ENABLE_MODULES'] = 'NO'
            
            # 在生成的 Pods 项目文件中加入 CC 参数,路径的值根据你自己的项目来修改
            config.build_settings['CC'] = '$(PODS_ROOT)/ccache-clang++.sh'
        end  
    end  
end

image.png
注意,可能些framework还得自己导入。根据报错来加就行,原文中的pod的库的依赖,我这里并没有加,可能原项目比较规范已经加好了。
成果,不知道是不是心理作用,记得brew install ccache image.png

相关文章

网友评论

      本文标题:iOS 加速编译 ccache 初使用

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