Build each architecture into its own APK

* This means we can have all the architectures we care about installed,
  and load the right library regardless of what the app does.
This commit is contained in:
baldurk
2018-01-26 21:19:16 +00:00
parent 077402bf11
commit ec7b2807d0
14 changed files with 256 additions and 201 deletions
+14 -2
View File
@@ -102,17 +102,29 @@ if(ANDROID)
endif()
message(STATUS "Building APK versionCode ${APK_VERSION_CODE}, versionName ${APK_VERSION_NAME}")
# Set the package name based on the ABI
if(ANDROID_ABI STREQUAL "armeabi-v7a")
set(RENDERDOC_ANDROID_PACKAGE_NAME "org.renderdoc.renderdoccmd.arm32")
elseif(ANDROID_ABI STREQUAL "arm64-v8a")
set(RENDERDOC_ANDROID_PACKAGE_NAME "org.renderdoc.renderdoccmd.arm64")
else()
message(FATAL_ERROR "ABI ${ANDROID_ABI} is not supported.")
endif()
set(APK_FILE ${CMAKE_BINARY_DIR}/bin/RenderDocCmd.apk)
set(APK_FILE ${CMAKE_BINARY_DIR}/bin/${RENDERDOC_ANDROID_PACKAGE_NAME}.apk)
add_custom_target(apk ALL
DEPENDS ${APK_FILE}
DEPENDS ${KEYSTORE})
# Copy in android package files, replacing the package name with the architecture-specific package name
configure_file(android/Loader.java ${CMAKE_CURRENT_BINARY_DIR}/src/org/renderdoc/renderdoccmd/Loader.java)
configure_file(android/AndroidManifest.xml ${CMAKE_CURRENT_BINARY_DIR}/AndroidManifest.xml)
configure_file(android/icon.png ${CMAKE_CURRENT_BINARY_DIR}/res/drawable/icon.png COPYONLY)
add_custom_command(OUTPUT ${APK_FILE}
DEPENDS renderdoc
DEPENDS renderdoccmd
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/android ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E make_directory libs/lib/${ANDROID_ABI}
COMMAND ${CMAKE_COMMAND} -E make_directory obj
COMMAND ${CMAKE_COMMAND} -E make_directory bin
+2 -2
View File
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<!-- BEGIN_INCLUDE(manifest) -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.renderdoc.renderdoccmd">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="@RENDERDOC_ANDROID_PACKAGE_NAME@">
<!-- This is the platform API where NativeActivity was introduced. -->
<uses-sdk android:minSdkVersion="23" android:targetSdkVersion="23"/>
@@ -11,7 +11,7 @@
<!-- Use GL ES 3.2 version -->
<uses-feature android:glEsVersion="0x00030002" android:required="true" />
<application android:label="RenderDocCmd" android:icon="@drawable/icon" android:hasCode="true">
<application android:debuggable="true" android:label="RenderDocCmd" android:icon="@drawable/icon" android:hasCode="true">
<activity android:name=".Loader" android:label="RenderDoc" android:exported="true" android:screenOrientation="landscape" android:configChanges="orientation|keyboardHidden">
<meta-data android:name="android.app.lib_name" android:value="renderdoccmd"/>
</activity>
@@ -1,4 +1,4 @@
package org.renderdoc.renderdoccmd;
package @RENDERDOC_ANDROID_PACKAGE_NAME@;
import android.app.Activity;
public class Loader extends android.app.NativeActivity

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB