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

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

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

四、Module为NO

五、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

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

网友评论