From fad4f256767438d7fb680e92aa7a3afed6a2dd36 Mon Sep 17 00:00:00 2001 From: saschawillems Date: Thu, 10 May 2018 17:22:01 +0200 Subject: [PATCH] Updated triangle build files --- android/examples/triangle/CMakeLists.txt | 15 ++++++----- android/examples/triangle/build.gradle | 15 +++++------ android/examples/triangle/proguard-rules.pro | 25 ------------------- .../triangle/src/main/AndroidManifest.xml | 2 +- .../vulkanSample/VulkanActivity.java | 2 +- 5 files changed, 17 insertions(+), 42 deletions(-) delete mode 100644 android/examples/triangle/proguard-rules.pro diff --git a/android/examples/triangle/CMakeLists.txt b/android/examples/triangle/CMakeLists.txt index c92c2114..2faa4ed6 100644 --- a/android/examples/triangle/CMakeLists.txt +++ b/android/examples/triangle/CMakeLists.txt @@ -9,29 +9,28 @@ set(EXTERNAL_DIR ../../../external) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES") file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp") -file(GLOB BASE_SRC "${BASE_DIR}/*.cpp") -add_library( - native-lib SHARED - ${EXAMPLE_SRC} - ${BASE_SRC} - ${EXTERNAL_DIR}/imgui/imgui.cpp - ${EXTERNAL_DIR}/imgui/imgui_draw.cpp -) +add_library(native-lib SHARED ${EXAMPLE_SRC}) add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c) +add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base) + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate") include_directories(${BASE_DIR}) +include_directories(${EXTERNAL_DIR}) include_directories(${EXTERNAL_DIR}/glm) include_directories(${EXTERNAL_DIR}/gli) include_directories(${EXTERNAL_DIR}/imgui) +include_directories(${EXTERNAL_DIR}/assimp) include_directories(${ANDROID_NDK}/sources/android/native_app_glue) target_link_libraries( native-lib native-app-glue + libbase android log + z ) diff --git a/android/examples/triangle/build.gradle b/android/examples/triangle/build.gradle index 70ec5fe0..7c3fd7b0 100644 --- a/android/examples/triangle/build.gradle +++ b/android/examples/triangle/build.gradle @@ -4,19 +4,18 @@ apply from: '../gradle/outputfilename.gradle' android { compileSdkVersion 26 defaultConfig { - applicationId "de.saschawillems.VulkanTriangle" + applicationId "de.saschawillems.vulkanTriangle" minSdkVersion 19 targetSdkVersion 26 versionCode 1 versionName "1.0" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" ndk { abiFilters "armeabi-v7a" } externalNativeBuild { cmake { - cppFlags "-std=c++11" - arguments "-DANDROID_STL=c++_static" + cppFlags "-std=c++14" + arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang' } } } @@ -50,10 +49,12 @@ task copyTask << { } copy { - from '../../../data/shaders/triangle' - into "assets/shaders/triangle" - include '*.spv' + from '../../../data/shaders/triangle' + into 'assets/shaders/triangle' + include '*.*' } + + } preBuild.dependsOn copyTask \ No newline at end of file diff --git a/android/examples/triangle/proguard-rules.pro b/android/examples/triangle/proguard-rules.pro deleted file mode 100644 index 93aade8d..00000000 --- a/android/examples/triangle/proguard-rules.pro +++ /dev/null @@ -1,25 +0,0 @@ -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in /home/SERILOCAL/l.west/Android/Sdk/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the proguardFiles -# directive in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile diff --git a/android/examples/triangle/src/main/AndroidManifest.xml b/android/examples/triangle/src/main/AndroidManifest.xml index f0852aea..3dd53b0b 100644 --- a/android/examples/triangle/src/main/AndroidManifest.xml +++ b/android/examples/triangle/src/main/AndroidManifest.xml @@ -3,7 +3,7 @@ package="de.saschawillems.vulkanTriangle">