使用ccache 加速编译cocos2dx项目 android NDK

来源:互联网 发布:nba2k16麦迪捏脸数据 编辑:程序博客网 时间:2024/05/17 10:03

ccache 和ndk 版本 (最新版本ccache-3.3.4 android-ndk-r10d)

1、安装ccache
2、配置~/.bash_profile

export NDK_CCACHE=ccacheexport USE_CCACHE=1export CCACHE_LOGFILE='/Users/zt-2205515/Desktop/ccache.log'

3、修改 android-ndk-r10d/build/core/default-build-commands.mk 使用ccache 命令

这里写图片描述

4、使用ccache -s查看命中等情况

这里写图片描述

查看到cache hit rate 、 cache hit(preprocessed) 有值时,表示已经有文件ccache 成功。
(Tips: 第一次是全部编译,是cccahe全是失败的)

当后续还是cccahe 失败时,可通过CCACHE_LOGFILE 日志文件查看ccache 失败的原因(有些g++的编译参数不支持ccache,可能也会导致失败的)

原创粉丝点击