windows平台android NDK的mk文件编写【2】—— 添加第三方头文件和*.so文件

修改Android.mk,添加第三方头文件和*.so文件

以opencv的头文件和*.so文件为例,目录结构如下:

C:\opencv-android-sdk
                   |–include
                        |–opencv2
                               |–calib3d
                                     |–calib3d.hpp
                                     |–calib3d_c.h
                               |–highgui
                                     |–highgui.hpp
                                     |–highgui_c.h
                               |–calib3d.hpp
                               |–highgui.hpp
                   |–libs
                        |–arm64-v8a
                               |–libopencv_java4.so

LOCAL_PATH:=$(call my-dir)

# opencv模块相关声明
include $(CLEAR_VARS)
LOCAL_MODULE:=libopencv_java4
LOCAL_SRC_FILES:=C:/opencv-android-sdk/libs/arm64-v8a/libopencv_java4.so
include $(PREBUILT_SHARED_LIBRARY)

# 在当前模块声明对opencv相关头文件和so的依赖
include $(CLEAR_VARS)
LOCAL_C_INCLUDES += C:/opencv-android-sdk/include
LOCAL_MODULE:=hello
LOCAL_SRC_FILES:=hello.cpp
LOCAL_SHARED_LIBRARIES:=libopencv_java4
include $(BUILD_EXECUTABLE)

你可能感兴趣的:(android,android,NDK)