From 5b5543e4155f18075cb7d1012ba56f0eb95f2530 Mon Sep 17 00:00:00 2001 From: saschawillems Date: Mon, 20 Jun 2016 20:05:33 +0200 Subject: [PATCH] Added android build files for terrain tessellation example --- android/terraintessellation/.gitignore | 10 ++++ .../terraintessellation/AndroidManifest.xml | 27 +++++++++++ android/terraintessellation/build.bat | 27 +++++++++++ android/terraintessellation/jni/Android.mk | 48 +++++++++++++++++++ .../terraintessellation/jni/Application.mk | 5 ++ 5 files changed, 117 insertions(+) create mode 100644 android/terraintessellation/.gitignore create mode 100644 android/terraintessellation/AndroidManifest.xml create mode 100644 android/terraintessellation/build.bat create mode 100644 android/terraintessellation/jni/Android.mk create mode 100644 android/terraintessellation/jni/Application.mk diff --git a/android/terraintessellation/.gitignore b/android/terraintessellation/.gitignore new file mode 100644 index 00000000..7a5d249c --- /dev/null +++ b/android/terraintessellation/.gitignore @@ -0,0 +1,10 @@ +/assets/ +/res/ +/bin/ +/libs/ +/obj/ +/build.xml +/local.properties +/project.properties +/proguard-project.txt +*.apk \ No newline at end of file diff --git a/android/terraintessellation/AndroidManifest.xml b/android/terraintessellation/AndroidManifest.xml new file mode 100644 index 00000000..5f2e0cf7 --- /dev/null +++ b/android/terraintessellation/AndroidManifest.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/android/terraintessellation/build.bat b/android/terraintessellation/build.bat new file mode 100644 index 00000000..8a81a029 --- /dev/null +++ b/android/terraintessellation/build.bat @@ -0,0 +1,27 @@ +cd jni +call ndk-build +if %ERRORLEVEL% EQU 0 ( + cd.. + + mkdir "assets\shaders\base" + xcopy "..\..\data\shaders\base\*.spv" "assets\shaders\base" /Y + + mkdir "assets\shaders\terraintessellation" + xcopy "..\..\data\shaders\terraintessellation\*.*" "assets\shaders\terraintessellation" /Y + + mkdir "assets\textures" + xcopy "..\..\data\textures\terrain_heightmap_r8.ktx" "assets\textures" /Y + xcopy "..\..\data\textures\terrain_texturearray_bc3.ktx" "assets\textures" /Y + xcopy "..\..\data\textures\skysphere_bc3.ktx" "assets\textures" /Y + + mkdir "assets\models" + xcopy "..\..\data\models\geosphere.obj" "assets\models" /Y + + mkdir "res\drawable" + xcopy "..\..\android\images\icon.png" "res\drawable" /Y + + call ant debug -Dout.final.file=vulkanTerraintessellation.apk +) ELSE ( + echo error : ndk-build failed with errors! + cd.. +) diff --git a/android/terraintessellation/jni/Android.mk b/android/terraintessellation/jni/Android.mk new file mode 100644 index 00000000..ddb1374f --- /dev/null +++ b/android/terraintessellation/jni/Android.mk @@ -0,0 +1,48 @@ +LOCAL_PATH := $(call my-dir)/../../terraintessellation + +# assimp + +include $(CLEAR_VARS) + +LOCAL_MODULE := assimp +LOCAL_SRC_FILES := $(LOCAL_PATH)/../../libs/assimp/$(TARGET_ARCH_ABI)/libassimp.a +include $(PREBUILT_STATIC_LIBRARY) + +# vulkan example + +DATADIR := $(LOCAL_PATH)/../../data + +include $(CLEAR_VARS) + +LOCAL_MODULE := vulkanTerraintessellation + +PROJECT_FILES := $(wildcard $(LOCAL_PATH)/../../terraintessellation/*.cpp) +PROJECT_FILES += $(wildcard $(LOCAL_PATH)/../../base/*.cpp) + +LOCAL_CPPFLAGS := -std=c++11 +LOCAL_CPPFLAGS += -D__STDC_LIMIT_MACROS +LOCAL_CPPFLAGS += -DVK_NO_PROTOTYPES +LOCAL_CPPFLAGS += -DVK_USE_PLATFORM_ANDROID_KHR + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../external/ +LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../external/glm +LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../external/gli +LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../external/assimp +LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../base/ +#LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../base/android + +LOCAL_SRC_FILES := $(PROJECT_FILES) + +LOCAL_LDLIBS := -landroid -llog -lz + +LOCAL_DISABLE_FORMAT_STRING_CHECKS := true +LOCAL_DISABLE_FATAL_LINKER_WARNINGS := true + +LOCAL_STATIC_LIBRARIES += android_native_app_glue +LOCAL_STATIC_LIBRARIES += cpufeatures +LOCAL_STATIC_LIBRARIES += libassimp + +include $(BUILD_SHARED_LIBRARY) + +$(call import-module, android/native_app_glue) +$(call import-module, android/cpufeatures) diff --git a/android/terraintessellation/jni/Application.mk b/android/terraintessellation/jni/Application.mk new file mode 100644 index 00000000..62020feb --- /dev/null +++ b/android/terraintessellation/jni/Application.mk @@ -0,0 +1,5 @@ +APP_PLATFORM := android-19 +APP_ABI := armeabi-v7a +APP_STL := c++_static +APP_CPPFLAGS := -std=c++11 +NDK_TOOLCHAIN_VERSION := clang