Switch from cmake to ndk-build

We switch from cmake to ndk-build to make it easier for builders
in not requiring an additional tool installed. The JNI build is
so simple so we don't really need much of a build tool anyway.
This commit is contained in:
Fredrik Fornwall
2016-09-24 20:22:10 +02:00
parent 8314a2756c
commit 3480bf7346
3 changed files with 13 additions and 7 deletions

View File

@@ -1,5 +0,0 @@
cmake_minimum_required(VERSION 3.4.1)
add_library(termux SHARED src/main/jni/termux.c)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -Wall -Wextra -Os -fno-stack-protector -Wl,--gc-sections")

View File

@@ -16,6 +16,12 @@ android {
versionCode 42 versionCode 42
versionName "0.42" versionName "0.42"
externalNativeBuild {
ndkBuild {
cFlags "-std=c11 -Wall -Wextra -Werror -Os -fno-stack-protector -Wl,--gc-sections"
}
}
ndk { ndk {
abiFilters 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a' abiFilters 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'
} }
@@ -30,8 +36,8 @@ android {
} }
externalNativeBuild { externalNativeBuild {
cmake { ndkBuild {
path "CMakeLists.txt" path "src/main/jni/Android.mk"
} }
} }
} }

View File

@@ -0,0 +1,5 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE:= libtermux
LOCAL_SRC_FILES:= termux.c
include $(BUILD_SHARED_LIBRARY)