From dc202a98fbd63ba42ac4e61586877fa0a86e9f21 Mon Sep 17 00:00:00 2001 From: Cody Northrop Date: Thu, 22 Sep 2016 11:08:37 -0600 Subject: [PATCH] demos: Fix Smoke build for Android It doesn't appear that this ever worked. --- BUILD.md | 10 ++++++++++ demos/smoke/android/build-and-install | 12 ++++++++++++ demos/smoke/android/build.gradle | 3 ++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/BUILD.md b/BUILD.md index 286e75e..06dee6a 100644 --- a/BUILD.md +++ b/BUILD.md @@ -189,6 +189,16 @@ adb install ./tri/bin/NativeActivity-debug.apk adb shell am start com.example.Cube/android.app.NativeActivity adb shell am start com.example.Tri/android.app.NativeActivity ``` +To build, install, and run the Smoke demo for Android, run the following, and any +prompts that come back from the script: +``` +./update_external_sources.sh --glslang +cd demos/smoke/android +export ANDROID_SDK_HOME= +export ANDROID_NDK_HOME= +./build-and-install +adb shell am start com.example.Smoke/android.app.NativeActivity +``` ## Ninja Builds - All Platforms The [Qt Creator IDE](https://qt.io/download-open-source/#section-2) can open a root CMakeList.txt as a project directly, and it provides tools within Creator to configure and generate Vulkan SDK build files for one to many targets concurrently, resolving configuration issues as needed. Alternatively, when invoking CMake use the -G Codeblocks Ninja option to generate Ninja build files to be used as project files for QtCreator diff --git a/demos/smoke/android/build-and-install b/demos/smoke/android/build-and-install index 7402ec4..1c1d0f9 100755 --- a/demos/smoke/android/build-and-install +++ b/demos/smoke/android/build-and-install @@ -12,12 +12,23 @@ then echo "Please set ANDROID_NDK_HOME, exiting"; exit; else echo "ANDROID_NDK_HOME is ${ANDROID_NDK_HOME}"; fi + generate_local_properties() { : > local.properties echo "sdk.dir=${ANDROID_SDK_HOME}" >> local.properties echo "ndk.dir=${ANDROID_NDK_HOME}" >> local.properties } +glslang=$(realpath ../../../external/glslang/build/install/bin/glslangValidator) + +prebuild() { + ( cd ..; python3 generate-dispatch-table HelpersDispatchTable.h ) + ( cd ..; python3 generate-dispatch-table HelpersDispatchTable.cpp ) + ( cd ..; python3 glsl-to-spirv Smoke.frag Smoke.frag.h ${glslang} ) + ( cd ..; python3 glsl-to-spirv Smoke.vert Smoke.vert.h ${glslang} ) + ( cd ..; python3 glsl-to-spirv Smoke.push_constant.vert Smoke.push_constant.vert.h ${glslang} ) +} + build() { ./gradlew build } @@ -32,6 +43,7 @@ run() { } generate_local_properties +prebuild build install #run diff --git a/demos/smoke/android/build.gradle b/demos/smoke/android/build.gradle index a620153..38fa1ac 100644 --- a/demos/smoke/android/build.gradle +++ b/demos/smoke/android/build.gradle @@ -11,7 +11,7 @@ buildscript { apply plugin: 'com.android.model.application' def demosDir = "../.." -def smokeDir = "${demosDir}/Smoke" +def smokeDir = "${demosDir}/smoke" def glmDir = "${demosDir}/../libs" def vulkanDir = "${demosDir}/../include" @@ -65,6 +65,7 @@ model { srcDir "${smokeDir}" exclude 'ShellXcb.cpp' exclude 'ShellWin32.cpp' + exclude 'ShellWayland.cpp' } } } -- 2.7.4