aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCody Northrop <cnorthrop@google.com>2016-09-22 11:08:37 -0600
committerCody Northrop <cnorthrop@google.com>2016-09-23 08:32:58 -0600
commitdc202a98fbd63ba42ac4e61586877fa0a86e9f21 (patch)
tree05fabaeb2e50222a83f8468939a0c51e05fa3198
parentc0cbab5fa6ac3ba76f6f2d60da11c00c52fc6cbc (diff)
downloadusermoji-dc202a98fbd63ba42ac4e61586877fa0a86e9f21.tar.xz
demos: Fix Smoke build for Android
It doesn't appear that this ever worked.
-rw-r--r--BUILD.md10
-rwxr-xr-xdemos/smoke/android/build-and-install12
-rw-r--r--demos/smoke/android/build.gradle3
3 files changed, 24 insertions, 1 deletions
diff --git a/BUILD.md b/BUILD.md
index 286e75ee..06dee6a1 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=<path to Android/Sdk>
+export ANDROID_NDK_HOME=<path to Android/Sdk/ndk-bundle>
+./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 7402ec4f..1c1d0f99 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 a6201538..38fa1ac6 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'
}
}
}