From d6a6498781cbdd63c0c018f5ffab39e16e920035 Mon Sep 17 00:00:00 2001 From: Juan Ramos Date: Tue, 10 Oct 2023 17:03:54 -0600 Subject: cmake: Remove ndk-build Successfully ran VkCube.apk on my Pixel3 closes #850 --- cube/android/.gitignore | 3 -- cube/android/AndroidManifest.xml | 26 ++++++++++++++++ cube/android/CMakeLists.txt | 2 ++ cube/android/README.md | 13 ++++++++ cube/android/cube-with-layers/AndroidManifest.xml | 27 ---------------- cube/android/cube-with-layers/custom_rules.xml | 25 --------------- .../cube-with-layers/res/values/strings.xml | 24 --------------- cube/android/cube/AndroidManifest.xml | 27 ---------------- cube/android/cube/custom_rules.xml | 6 ---- cube/android/cube/res/values/strings.xml | 24 --------------- cube/android/jni/Android.mk | 36 ---------------------- cube/android/jni/Application.mk | 20 ------------ 12 files changed, 41 insertions(+), 192 deletions(-) delete mode 100644 cube/android/.gitignore create mode 100644 cube/android/AndroidManifest.xml delete mode 100644 cube/android/cube-with-layers/AndroidManifest.xml delete mode 100644 cube/android/cube-with-layers/custom_rules.xml delete mode 100644 cube/android/cube-with-layers/res/values/strings.xml delete mode 100644 cube/android/cube/AndroidManifest.xml delete mode 100644 cube/android/cube/custom_rules.xml delete mode 100644 cube/android/cube/res/values/strings.xml delete mode 100644 cube/android/jni/Android.mk delete mode 100644 cube/android/jni/Application.mk (limited to 'cube/android') diff --git a/cube/android/.gitignore b/cube/android/.gitignore deleted file mode 100644 index 8008f254..00000000 --- a/cube/android/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -bin -libs -obj diff --git a/cube/android/AndroidManifest.xml b/cube/android/AndroidManifest.xml new file mode 100644 index 00000000..fbec106d --- /dev/null +++ b/cube/android/AndroidManifest.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cube/android/CMakeLists.txt b/cube/android/CMakeLists.txt index 9d4e69c8..5783fa90 100644 --- a/cube/android/CMakeLists.txt +++ b/cube/android/CMakeLists.txt @@ -48,6 +48,8 @@ target_sources(android_glue PRIVATE ${native_app_glue_dir}/android_native_app_glue.h ) +set_target_properties(vkcube PROPERTIES OUTPUT_NAME "VkCube") + target_link_libraries(vkcube PRIVATE android_glue log diff --git a/cube/android/README.md b/cube/android/README.md index 75b1747f..08ed7488 100644 --- a/cube/android/README.md +++ b/cube/android/README.md @@ -26,3 +26,16 @@ Then run the script: ./generate_vulkan_wrapper.py ../cube/android/vulkan_wrapper.cpp clang-format -i vulkan_wrapper.h clang-format -i vulkan_wrapper.cpp + +# Running vkcube on Android + +```bash +cd build-android + +# Optional +adb uninstall com.example.VkCube + +adb install -r -g --no-incremental bin/VkCube.apk + +adb shell am start com.example.VkCube/android.app.NativeActivity +``` \ No newline at end of file diff --git a/cube/android/cube-with-layers/AndroidManifest.xml b/cube/android/cube-with-layers/AndroidManifest.xml deleted file mode 100644 index 50b216e4..00000000 --- a/cube/android/cube-with-layers/AndroidManifest.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/cube/android/cube-with-layers/custom_rules.xml b/cube/android/cube-with-layers/custom_rules.xml deleted file mode 100644 index 0ca5933e..00000000 --- a/cube/android/cube-with-layers/custom_rules.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - -VkCubeWithLayers: Creating libs-with-layers - - -VkCubeWithLayers: Copying libs from demos/android - - - - -VkCubeWithLayers: Copying layers from build-android - - - - - -VkCubeWithLayers: Overriding native.libs.absolute.dir with ${cubeWithLayersDir} - - - diff --git a/cube/android/cube-with-layers/res/values/strings.xml b/cube/android/cube-with-layers/res/values/strings.xml deleted file mode 100644 index ecd779e4..00000000 --- a/cube/android/cube-with-layers/res/values/strings.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - VkCubeWithLayers - - diff --git a/cube/android/cube/AndroidManifest.xml b/cube/android/cube/AndroidManifest.xml deleted file mode 100644 index 1bf9080b..00000000 --- a/cube/android/cube/AndroidManifest.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/cube/android/cube/custom_rules.xml b/cube/android/cube/custom_rules.xml deleted file mode 100644 index 31eb31ad..00000000 --- a/cube/android/cube/custom_rules.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - -vkcube: Overriding native.libs.absolute.dir with ../libs - - diff --git a/cube/android/cube/res/values/strings.xml b/cube/android/cube/res/values/strings.xml deleted file mode 100644 index 8adead25..00000000 --- a/cube/android/cube/res/values/strings.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - VkCube - - diff --git a/cube/android/jni/Android.mk b/cube/android/jni/Android.mk deleted file mode 100644 index 090f7862..00000000 --- a/cube/android/jni/Android.mk +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright 2015 The Android Open Source Project -# Copyright (C) 2015 Valve Corporation - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -LOCAL_PATH := $(abspath $(call my-dir)) -SRC_DIR := $(LOCAL_PATH)/../../.. -DEMO_DIR := $(SRC_DIR)/cube - -include $(CLEAR_VARS) -LOCAL_MODULE := VkCube -LOCAL_SRC_FILES += $(DEMO_DIR)/cube.c \ - $(DEMO_DIR)/android/vulkan_wrapper.cpp \ - $(DEMO_DIR)/android/android_util.cpp -LOCAL_C_INCLUDES += $(SRC_DIR)/build-android/third_party/Vulkan-Headers/include \ - $(DEMO_DIR)/android/include \ - $(SRC_DIR)/libs \ - $(DEMO_DIR)/android/ \ - $(SRC_DIR)/build-android/generated/include -LOCAL_CFLAGS += -DVK_USE_PLATFORM_ANDROID_KHR --include=$(DEMO_DIR)/android/vulkan_wrapper.h -LOCAL_WHOLE_STATIC_LIBRARIES += android_native_app_glue -LOCAL_LDLIBS := -llog -landroid -LOCAL_LDFLAGS := -u ANativeActivity_onCreate -include $(BUILD_SHARED_LIBRARY) - -$(call import-module,android/native_app_glue) diff --git a/cube/android/jni/Application.mk b/cube/android/jni/Application.mk deleted file mode 100644 index 788ff73b..00000000 --- a/cube/android/jni/Application.mk +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2015 The Android Open Source Project -# Copyright (C) 2015 Valve Corporation - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -APP_ABI := armeabi-v7a arm64-v8a x86 x86_64 -APP_PLATFORM := android-23 -APP_STL := c++_static -APP_MODULES := VkCube -NDK_TOOLCHAIN_VERSION := clang -- cgit v1.2.3