aboutsummaryrefslogtreecommitdiff
path: root/tools/Vulkan-Tools/cube/android
diff options
context:
space:
mode:
Diffstat (limited to 'tools/Vulkan-Tools/cube/android')
-rw-r--r--tools/Vulkan-Tools/cube/android/AndroidManifest.xml26
-rw-r--r--tools/Vulkan-Tools/cube/android/CMakeLists.txt57
-rw-r--r--tools/Vulkan-Tools/cube/android/android_util.cpp84
-rw-r--r--tools/Vulkan-Tools/cube/android/android_util.h32
4 files changed, 0 insertions, 199 deletions
diff --git a/tools/Vulkan-Tools/cube/android/AndroidManifest.xml b/tools/Vulkan-Tools/cube/android/AndroidManifest.xml
deleted file mode 100644
index fbec106d..00000000
--- a/tools/Vulkan-Tools/cube/android/AndroidManifest.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.VkCube" android:versionCode="1" android:versionName="1.0">
-
- <!-- Allow this app to read and write files (for use by tracing libraries). -->
- <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
- <uses-permission android:name="android.permission.INTERNET"/>
-
- <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="23"/>
-
- <!-- This .apk has no Java code itself, so set hasCode to false. -->
- <application android:label="VkCube" android:hasCode="false" android:debuggable='true'>
-
- <!-- Our activity is the built-in NativeActivity framework class.
- This will take care of integrating with our NDK code. -->
- <activity android:name="android.app.NativeActivity" android:label="VkCube" android:exported="true">
- <!-- Tell NativeActivity the name of or .so -->
- <meta-data android:name="android.app.lib_name" android:value="VkCube"/>
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
- <category android:name="android.intent.category.LAUNCHER"/>
- </intent-filter>
- </activity>
- </application>
-
-</manifest>
diff --git a/tools/Vulkan-Tools/cube/android/CMakeLists.txt b/tools/Vulkan-Tools/cube/android/CMakeLists.txt
deleted file mode 100644
index af607a55..00000000
--- a/tools/Vulkan-Tools/cube/android/CMakeLists.txt
+++ /dev/null
@@ -1,57 +0,0 @@
-# ~~~
-# Copyright (c) 2023 Valve Corporation
-# Copyright (c) 2023 LunarG, Inc.
-#
-# 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.
-# ~~~
-
-target_sources(vkcube PRIVATE
- android_util.cpp
- android_util.h
-)
-
-target_include_directories(vkcube PRIVATE
- .
-)
-
-set_directory_properties(PROPERTIES "COMPILE_OPTIONS" "") # Disable compiler warnings for android glue
-
-set(native_app_glue_dir "${CMAKE_ANDROID_NDK}/sources/android/native_app_glue")
-
-if (NOT EXISTS ${native_app_glue_dir})
- message(FATAL_ERROR "Couldn't find Android Native Glue directory!")
-endif()
-
-# https://stackoverflow.com/questions/57189936/compiling-native-app-glue-c-results-in-an-invalid-library-file/76963564#76963564
-add_library(android_glue OBJECT)
-
-target_include_directories(android_glue PUBLIC ${native_app_glue_dir})
-target_sources(android_glue PRIVATE
- ${native_app_glue_dir}/android_native_app_glue.c
- ${native_app_glue_dir}/android_native_app_glue.h
-)
-
-set_target_properties(vkcube PROPERTIES OUTPUT_NAME "VkCube")
-
-target_link_libraries(vkcube
- android_glue
- log
- android
-)
-
-# https://stackoverflow.com/questions/76631917/cmake-how-to-install-shared-stl-libraries-for-android/76656492#76656492
-if ("${CMAKE_ANDROID_STL_TYPE}" MATCHES "shared")
- file(READ "${CMAKE_ANDROID_NDK}/meta/abis.json" JSON_FILE)
- string(JSON TRIPLE GET "${JSON_FILE}" "${CMAKE_ANDROID_ARCH_ABI}" "triple")
- install(FILES "${CMAKE_SYSROOT}/usr/lib/${TRIPLE}/libc++_shared.so" DESTINATION "${CMAKE_INSTALL_LIBDIR}")
-endif()
diff --git a/tools/Vulkan-Tools/cube/android/android_util.cpp b/tools/Vulkan-Tools/cube/android/android_util.cpp
deleted file mode 100644
index 173e8ab8..00000000
--- a/tools/Vulkan-Tools/cube/android/android_util.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2016 Google, Inc.
- *
- * 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.
- *
- * Relicensed from the WTFPL (http://www.wtfpl.net/faq/).
- */
-
-#include "android_util.h"
-#include <android_native_app_glue.h>
-#include <cassert>
-#include <cstring>
-#include <vector>
-#include <string>
-#include <sstream>
-#include <stdlib.h>
-
-extern "C" {
-
-// Convert Intents to arg list, returning argc and argv
-// Note that this C routine mallocs memory that the caller must free
-char **get_args(struct android_app *app, const char *intent_extra_data_key, const char *appTag, int *count) {
- std::vector<std::string> args;
- JavaVM &vm = *app->activity->vm;
- JNIEnv *p_env;
- if (vm.AttachCurrentThread(&p_env, nullptr) != JNI_OK) return nullptr;
-
- JNIEnv &env = *p_env;
- jobject activity = app->activity->clazz;
- jmethodID get_intent_method = env.GetMethodID(env.GetObjectClass(activity), "getIntent", "()Landroid/content/Intent;");
- jobject intent = env.CallObjectMethod(activity, get_intent_method);
- jmethodID get_string_extra_method =
- env.GetMethodID(env.GetObjectClass(intent), "getStringExtra", "(Ljava/lang/String;)Ljava/lang/String;");
- jvalue get_string_extra_args;
- get_string_extra_args.l = env.NewStringUTF(intent_extra_data_key);
- jstring extra_str = static_cast<jstring>(env.CallObjectMethodA(intent, get_string_extra_method, &get_string_extra_args));
-
- std::string args_str;
- if (extra_str) {
- const char *extra_utf = env.GetStringUTFChars(extra_str, nullptr);
- args_str = extra_utf;
- env.ReleaseStringUTFChars(extra_str, extra_utf);
- env.DeleteLocalRef(extra_str);
- }
-
- env.DeleteLocalRef(get_string_extra_args.l);
- env.DeleteLocalRef(intent);
- vm.DetachCurrentThread();
-
- // split args_str
- std::stringstream ss(args_str);
- std::string arg;
- while (std::getline(ss, arg, ' ')) {
- if (!arg.empty()) args.push_back(arg);
- }
-
- // Convert our STL results to C friendly constructs
- assert(count != nullptr);
- *count = args.size() + 1;
- char **vector = (char **)malloc(*count * sizeof(char *));
- const char *appName = appTag ? appTag : (const char *)"appTag";
-
- vector[0] = (char *)malloc(strlen(appName) * sizeof(char));
- strcpy(vector[0], appName);
-
- for (uint32_t i = 0; i < args.size(); i++) {
- vector[i + 1] = (char *)malloc(strlen(args[i].c_str()) * sizeof(char));
- strcpy(vector[i + 1], args[i].c_str());
- }
-
- return vector;
-}
-
-} // extern "C"
diff --git a/tools/Vulkan-Tools/cube/android/android_util.h b/tools/Vulkan-Tools/cube/android/android_util.h
deleted file mode 100644
index e8966458..00000000
--- a/tools/Vulkan-Tools/cube/android/android_util.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 2016 Google, Inc.
- *
- * 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.
- *
- * Relicensed from the WTFPL (http://www.wtfpl.net/faq/).
- */
-
-#ifndef ANDROID_UTIL_H
-#define ANDROID_UTIL_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-char **get_args(struct android_app *app, const char *intent_extra_data_key, const char *appTag, int *count);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif