欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Android.mk配置事项

程序员文章站 2022-06-06 17:38:33
...
  • 预构建库编译
    例:导入静态库libx264.a和动态库libx264-148.so
    Android.mk配置事项
LOCAL_PATH := $(call my-dir)
    #第一组
include $(CLEAR_VARS)
LOCAL_MODULE := X264
LOCAL_SRC_FILES := $(LOCAL_PATH)/X264/libx264.a #导入库时LOCAL_SRC_FILES只能有一个库文件
LOCAL_C_INCLUDES += $(LOCAL_PATH)/include/
include $(PREBUILT_STATIC_LIBRARY) #预编译静态库

    #第二组
include $(CLEAR_VARS)
LOCAL_MODULE := x264-148
LOCAL_SRC_FILES := $(LOCAL_PATH)/X264/libx264-148.so
LOCAL_C_INCLUDES += $(LOCAL_PATH)/include/
include $(PREBUILT_SHARED_LIBRARY) #预编译动态库

    #第三组
include $(CLEAR_VARS)
LOCAL_MODULE := hi_jni
LOCAL_SRC_FILES := hi_jni.cpp
LOCAL_C_INCLUDES += $(LOCAL_PATH)
LOCAL_STATIC_LIBRARIES := x264 #要链接到本模块的静态库list
LOCAL_SHARED_LIBRARIES := x264-148 #要链接到本模块的动态库list
LOCAL_LDLIBS := -llog #要链接到本模块的系统库
include $(BUILD_SHARED_LIBRARY) #构建动态库
  • 列表内容
这里写代码片
相关标签: NDK