From af5d44b603dde125e9d116dbba516c7c211be8ba Mon Sep 17 00:00:00 2001 From: joliver82 Date: Wed, 14 Nov 2018 16:43:27 +0100 Subject: [PATCH] Update android bullet native, mk files and gradle adding header generation dependency --- gradle.properties | 2 +- jme3-bullet-native-android/build.gradle | 3 ++- .../src/native/android/Android.mk | 15 +++++++++++++-- .../src/native/android/Application.mk | 5 ++++- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/gradle.properties b/gradle.properties index 5500ed316..b1ef45553 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,7 +16,7 @@ buildAndroidExamples = false # Path to android NDK for building native libraries #ndkPath=/Users/normenhansen/Documents/Code-Import/android-ndk-r7 -ndkPath = /opt/android-ndk-r10c +ndkPath = /opt/android-ndk-r16b # Path for downloading native Bullet bulletUrl = https://github.com/bulletphysics/bullet3/archive/2.86.1.zip diff --git a/jme3-bullet-native-android/build.gradle b/jme3-bullet-native-android/build.gradle index 499330a9e..1058ef322 100644 --- a/jme3-bullet-native-android/build.gradle +++ b/jme3-bullet-native-android/build.gradle @@ -104,7 +104,8 @@ task copyJmeAndroid(type: Copy) { into outputDir } -task buildBulletNativeLib(type: Exec, dependsOn: [copyJmeAndroid, copyJmeCpp, copyBullet]) { +//dependsOn ':jme3-bullet:generateNativeHeaders' +task buildBulletNativeLib(type: Exec, dependsOn: [copyJmeAndroid, ':jme3-bullet:generateNativeHeaders', copyJmeCpp, copyBullet]) { // args 'TARGET_PLATFORM=android-9' // println "buildBulletNativeLib ndkWorkingPath: " + ndkWorkingPath // println "buildBulletNativeLib rootProject.ndkCommandPath: " + rootProject.ndkCommandPath diff --git a/jme3-bullet-native-android/src/native/android/Android.mk b/jme3-bullet-native-android/src/native/android/Android.mk index b46f8ec29..1a1e64b89 100644 --- a/jme3-bullet-native-android/src/native/android/Android.mk +++ b/jme3-bullet-native-android/src/native/android/Android.mk @@ -54,12 +54,23 @@ LOCAL_C_INCLUDES := $(BULLET_PATH)/\ $(BULLET_PATH)/vectormath/sse\ $(BULLET_PATH)/vectormath/neon -LOCAL_CFLAGS := $(LOCAL_C_INCLUDES:%=-I%) +#ARM mode more performant than thumb for old armeabi +ifeq ($(TARGET_ARCH_ABI),$(filter $(TARGET_ARCH_ABI), armeabi)) +LOCAL_ARM_MODE := arm +endif + +#Enable neon for armv7 +ifeq ($(TARGET_ARCH_ABI),$(filter $(TARGET_ARCH_ABI), armeabi-v7a)) +LOCAL_ARM_NEON := true +endif + +LOCAL_CFLAGS := $(LOCAL_C_INCLUDES:%=-I%) LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -ldl -lm -llog FILE_LIST := $(wildcard $(LOCAL_PATH)/*.cpp) FILE_LIST += $(wildcard $(LOCAL_PATH)/**/*.cpp) FILE_LIST += $(wildcard $(LOCAL_PATH)/**/**/*.cpp) +FILE_LIST := $(filter-out $(wildcard $(LOCAL_PATH)/Bullet3OpenCL/**/*.cpp), $(FILE_LIST)) LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%) -include $(BUILD_SHARED_LIBRARY) \ No newline at end of file +include $(BUILD_SHARED_LIBRARY) diff --git a/jme3-bullet-native-android/src/native/android/Application.mk b/jme3-bullet-native-android/src/native/android/Application.mk index 34f65f6e8..44c5c842e 100644 --- a/jme3-bullet-native-android/src/native/android/Application.mk +++ b/jme3-bullet-native-android/src/native/android/Application.mk @@ -1,4 +1,7 @@ APP_OPTIM := release APP_ABI := all -#APP_ABI := armeabi-v7a +APP_STL := stlport_static +# gnustl_static or stlport_static APP_MODULES := bulletjme +APP_CFLAGS += -funroll-loops -Ofast +