上文我们讲完LOCAL_SRC_FILES,下面我们就一步步来梳理下LOCAL_STATIC_LIBRARIES。
一、 初识LOCAL_STATIC_LIBRARIES
我们首先看看该变量在NDK文档中的定义:
LOCAL_STATIC_LIBRARIES
应该链接到这个模块的静态库列表(使用 BUILD_STATIC_LIBRARY 生成),这仅仅对共享库模块才有意义。
The list of static libraries modules (built with BUILD_STATIC_LIBRARY) that should be linked to this module. This only makes sense in shared library modules.
The list of static libraries modules (built with BUILD_STATIC_LIBRARY) that should be linked to this module. This only makes sense in shared library modules.
最后一句“这仅仅对共享库模块才有意义”我们先不管,从上述定义中我们知道,LOCAL_STATIC_LIBRARIES肯定是描述了编译当前模块需要的静态库。
在acp模块的编译文件Android.mk中有LOCAL_STATIC_LIBRARIES的定义:LOCAL_STATIC_LIBRARIES := libhost,也就是描述了要编译本模块,必须已经先编译了libhost.a静态库。
但是如果我没有编译出libhost.a静态库,为什么会报
*** No rule to make target `out/host/linux-x86/obj/STATIC_LIBRARIES/lib