Updated triangle build files
This commit is contained in:
parent
46795c4b6b
commit
fad4f25676
5 changed files with 17 additions and 42 deletions
|
|
@ -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
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
25
android/examples/triangle/proguard-rules.pro
vendored
25
android/examples/triangle/proguard-rules.pro
vendored
|
|
@ -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
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
package="de.saschawillems.vulkanTriangle">
|
||||
|
||||
<application
|
||||
android:label="Vulkan Triangle"
|
||||
android:label="Vulkan triangle"
|
||||
android:icon="@drawable/icon"
|
||||
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
|
||||
<activity android:name="de.saschawillems.vulkanSample.VulkanActivity"
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public class VulkanActivity extends NativeActivity {
|
|||
|
||||
this.runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(activity, AlertDialog.THEME_HOLO_DARK);
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
|
||||
builder.setTitle(applicationName);
|
||||
builder.setMessage(message);
|
||||
builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue