1.例子1
cc_binary { //编译成可执行文件,cc_library_shared编译成动态库 name: "bt_test", //编译出的可执行文件的名字为bt_test vendor: true, //编译出来放在/vendor目录下(默认是放在/system目录下) srcs: ["bt_test.cpp"], //源文件,格式["a.cpp", "b.cpp"] cflags: [ "-Wall", "-Werror", "-Wno-unused-parameter", ], //编译flag include_dirs: [ "hardware/interfaces/halnode/1.0/default", //用户值定的头文件查找路径 ], shared_libs: [ //编译依赖的动态库 "liblog", "libutils", "libhidltransport", "android.hardware.halnode@1.0", "libhidlbase", "libbase", ], }
2.其它可用选项
subdirs = ["ndk"] //指定进入下层ndk目录进行编译
export_include_dirs: [ "include", "include/camera" ],
export_shared_lib_headers: ["libcamera_metadata"],
local_include_dirs: ["aidl"],
static_libs: ["libupdater"], //指定对库libupdater进行静态链接 static_executable: true,