Add Android NDK complie supported.

Usage: ./ndk_make.sh [clean]
This commit is contained in:
rf.wu 2019-10-11 17:26:24 +08:00
parent b650bc8287
commit 1ef4ac48a0
4 changed files with 38 additions and 0 deletions

3
.gitignore vendored
View File

@ -1,3 +1,6 @@
build/
/tags
/bazel-*
libs/
obj/

14
Android.mk Normal file
View File

@ -0,0 +1,14 @@
LOCAL_PATH := $(call my-dir)
# --------------------------------------
include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/src/*.cpp)
LOCAL_C_INCLUDES += src/
LOCAL_C_INCLUDES += include/
LOCAL_LDLIBS := -llog
LOCAL_MODULE := yamlcpp
include $(BUILD_SHARED_LIBRARY)

6
Application.mk Normal file
View File

@ -0,0 +1,6 @@
APP_ABI := arm64-v8a x86_64
APP_PLATFORM := android-26
APP_STL := c++_shared
APP_CPPFLAGS := -fexceptions
APP_CPPFLAGS += -frtti
#APP_ALLOW_MISSING_DEPS = true

15
ndk_make.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
if [ $# -gt 1 ];then
echo "[Usage]: $0 or $0 clean."
exit
elif [ $# -eq 0 ];then
ndk-build NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=Android.mk NDK_APPLICATION_MK=Application.mk
elif [ $# -eq 1 ];then
if [ "$1" = "clean" ];then
ndk-build NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=Android.mk NDK_APPLICATION_MK=Application.mk clean
exit
else
echo "[Usage]: $0 or $0 clean."
exit
fi
fi