Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android release fixes #2187

Merged
merged 2 commits into from
Jun 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,7 @@ endif()

if(ANDROID)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/android-project/CMake")

set(ASAN OFF)
set(UBSAN OFF)
set(DEVILUTIONX_SYSTEM_LIBSODIUM OFF)
set(DISABLE_ZERO_TIER ON)
set(TTF_FONT_DIR \"\")

file(
COPY "${DevilutionX_SOURCE_DIR}/Packaging/resources/CharisSILB.ttf"
DESTINATION "${DevilutionX_SOURCE_DIR}/android-project/app/src/main/assets")
include(android_defs)
endif()

if(PIE)
Expand Down
17 changes: 17 additions & 0 deletions android-project/CMake/android_defs.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#General compilation options
set(ASAN OFF)
set(UBSAN OFF)
set(DEVILUTIONX_SYSTEM_LIBSODIUM OFF)
set(DISABLE_ZERO_TIER ON)

if(BINARY_RELEASE OR CMAKE_BUILD_TYPE STREQUAL "Release")
# Workaroudn linker bug in CLang: https://github.com/android/ndk/issues/721
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -flto=full")
endif()

#additional compilation definitions
set(TTF_FONT_DIR \"\")

file(
COPY "${DevilutionX_SOURCE_DIR}/Packaging/resources/CharisSILB.ttf"
DESTINATION "${DevilutionX_SOURCE_DIR}/android-project/app/src/main/assets")
10 changes: 5 additions & 5 deletions android-project/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ else {
}

android {
compileSdkVersion 28
compileSdkVersion 29
aaptOptions {
noCompress 'mpq'
}
Expand All @@ -17,12 +17,12 @@ android {
applicationId "org.diasurgical.devilutionx"
}
minSdkVersion 21
targetSdkVersion 28
targetSdkVersion 29
versionCode 18
versionName "1.2.1"
externalNativeBuild {
cmake {
arguments "-DANDROID_APP_PLATFORM=android-21", "-DANDROID_STL=c++_static"
arguments "-DANDROID_STL=c++_static"
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
}
Expand All @@ -43,9 +43,9 @@ android {
version "3.13.0+"
}
}

}

if (buildAsLibrary) {
libraryVariants.all { variant ->
variant.outputs.each { output ->
Expand Down
5 changes: 3 additions & 2 deletions android-project/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@
<application android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:allowBackup="true"
android:hardwareAccelerated="true" >
android:hardwareAccelerated="true"
android:requestLegacyExternalStorage="true">

<!-- Example of setting SDL hints from AndroidManifest.xml:
<meta-data android:name="SDL_ENV.SDL_ACCELEROMETER_AS_JOYSTICK" android:value="0"/>
-->

<activity android:name="org.diasurgical.devilutionx.DevilutionXSDLActivity"
android:label="@string/app_name"
android:alwaysRetainTaskState="true"
Expand Down