本文共 3327 字,大约阅读时间需要 11 分钟。
系统:Linux luogw-pc 3.5.0-36-generic #57~precise1-Ubuntu SMP Thu Jun 20 18:21:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
ndk: ndk-r8d
cache: ccache version 3.1.6
sudo apt-get install ccache
添加环境变量 export NDK_CCACHE=ccache
注:红色部份为修改的内容,原内容被注释掉
#
# IMPORTANT: The following definitions must use lazy assignment because # the value of TOOLCHAIN_PREFIX or TARGET_CFLAGS can be changed later by # the toolchain's setup.mk script. # ifneq ($(findstring ccc-analyzer,$(CC)),) TARGET_CC = $(CC) else #TARGET_CC = $(TOOLCHAIN_PREFIX)gcc TARGET_CC = ccache $(TOOLCHAIN_PREFIX)gcc endif TARGET_CFLAGS = ifneq ($(findstring c++-analyzer,$(CXX)),) TARGET_CXX = $(CXX) else #TARGET_CXX = $(TOOLCHAIN_PREFIX)g++ TARGET_CXX = ccache $(TOOLCHAIN_PREFIX)g++ endif TARGET_CXXFLAGS = $(TARGET_CFLAGS) -fno-exceptions -fno-rtti使用ccache前后情况对比如下
luogw@luogw-pc:~/study/bitmap-plasma$ ccache -scache directory /home/luogw/.ccachecache hit (direct) 0cache hit (preprocessed) 0cache miss 0files in cache 0cache size 0 Kbytesmax cache size 1.0 Gbytesluogw@luogw-pc:~/study/bitmap-plasma$ time ndk-buildGdbserver : [arm-linux-androideabi-4.7] libs/armeabi/gdbserverGdbsetup : libs/armeabi/gdb.setupGdbserver : [arm-linux-androideabi-4.7] libs/armeabi-v7a/gdbserverGdbsetup : libs/armeabi-v7a/gdb.setupCompile thumb : plasma <= plasma.cSharedLibrary : libplasma.soInstall : libplasma.so => libs/armeabi/libplasma.soCompile thumb : plasma <= plasma.cSharedLibrary : libplasma.soInstall : libplasma.so => libs/armeabi-v7a/libplasma.soreal 0m0.226suser 0m0.128ssys 0m0.032sluogw@luogw-pc:~/study/bitmap-plasma$ ccache -scache directory /home/luogw/.ccachecache hit (direct) 0cache hit (preprocessed) 0cache miss 2called for link 2multiple source files 2files in cache 6cache size 108 Kbytesmax cache size 1.0 Gbytesluogw@luogw-pc:~/study/bitmap-plasma$ rm -r libs/ obj/luogw@luogw-pc:~/study/bitmap-plasma$ time ndk-buildGdbserver : [arm-linux-androideabi-4.7] libs/armeabi/gdbserverGdbsetup : libs/armeabi/gdb.setupGdbserver : [arm-linux-androideabi-4.7] libs/armeabi-v7a/gdbserverGdbsetup : libs/armeabi-v7a/gdb.setupCompile thumb : plasma <= plasma.cSharedLibrary : libplasma.soInstall : libplasma.so => libs/armeabi/libplasma.soCompile thumb : plasma <= plasma.cSharedLibrary : libplasma.soInstall : libplasma.so => libs/armeabi-v7a/libplasma.soreal 0m0.114suser 0m0.052ssys 0m0.008sluogw@luogw-pc:~/study/bitmap-plasma$ ccache -scache directory /home/luogw/.ccachecache hit (direct) 2cache hit (preprocessed) 0cache miss 2called for link 4multiple source files 4files in cache 6cache size 108 Kbytesmax cache size 1.0 Gbytes
参考文章:
1)
2)
转载地址:http://blmbi.baihongyu.com/