Build fixes/updates

* Remove deprecation from build.gradle, settings.gradle

* Update to C++ 20

* Update GIT_TAG for adrenotools
This commit is contained in:
KeatonTheBot
2026-02-01 05:47:45 -06:00
parent 79ab37f282
commit 890d5a6e2c
5 changed files with 27 additions and 25 deletions
+15 -12
View File
@@ -4,21 +4,17 @@ plugins {
} }
android { android {
namespace 'org.kenjinx.android' namespace = 'org.kenjinx.android'
compileSdk 36 compileSdk 36
defaultConfig { defaultConfig {
applicationId "org.kenjinx.android" applicationId "org.kenjinx.android"
minSdk 29 minSdk 29
//noinspection EditedTargetSdkVersion
targetSdk 36 targetSdk 36
versionCode 20005 versionCode 20005
versionName '2.0.5' versionName '2.0.5'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary true
}
ndk { ndk {
//noinspection ChromeOsAbiSupport //noinspection ChromeOsAbiSupport
@@ -27,10 +23,11 @@ android {
externalNativeBuild { externalNativeBuild {
cmake { cmake {
cppFlags "-std=c++17 -O3 -ffast-math -march=armv8-a -funroll-loops" cppFlags "-std=c++20 -O3 -fno-math-errno -fno-trapping-math -fno-signed-zeros -ffinite-math-only -march=armv8-a"
arguments "-DANDROID_STL=c++_shared", arguments "-DANDROID_STL=c++_shared",
"-DCMAKE_BUILD_TYPE=Release", "-DCMAKE_BUILD_TYPE=Release",
"-DANDROID_ARM_NEON=TRUE" "-DANDROID_ARM_NEON=TRUE",
"-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON"
} }
} }
} }
@@ -39,25 +36,29 @@ android {
release { release {
minifyEnabled false minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.debug signingConfig = signingConfigs.debug
debuggable false debuggable false
jniDebuggable false jniDebuggable false
} }
} }
androidComponents { androidComponents {
onVariants(selector().withBuildType("release")) { onVariants(selector().withBuildType("release")) {
packaging.dex.useLegacyPackaging.set(true) packaging.dex.useLegacyPackaging.set(true)
} }
} }
compileOptions { compileOptions {
sourceCompatibility JavaVersion.VERSION_21 sourceCompatibility JavaVersion.VERSION_21
targetCompatibility JavaVersion.VERSION_21 targetCompatibility JavaVersion.VERSION_21
} }
buildFeatures { buildFeatures {
compose true compose = true
prefab true prefab = true
buildConfig true buildConfig = true
} }
packagingOptions { packagingOptions {
jniLibs { jniLibs {
keepDebugSymbols += '**/libkenjinx.so' keepDebugSymbols += '**/libkenjinx.so'
@@ -67,9 +68,11 @@ android {
excludes += '/META-INF/{AL2.0,LGPL2.1}' excludes += '/META-INF/{AL2.0,LGPL2.1}'
} }
} }
externalNativeBuild { externalNativeBuild {
cmake { cmake {
path file('src/main/cpp/CMakeLists.txt') path file('src/main/cpp/CMakeLists.txt')
version = '4.2.3'
} }
} }
@@ -112,7 +115,7 @@ dependencies {
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2'
implementation platform('androidx.compose:compose-bom:2026.01.01') implementation platform('androidx.compose:compose-bom:2026.01.01')
implementation platform('org.jetbrains.kotlin:kotlin-bom:1.9.25') implementation platform('org.jetbrains.kotlin:kotlin-bom:2.3.0')
androidTestImplementation 'androidx.compose.ui:ui-test-junit4' androidTestImplementation 'androidx.compose.ui:ui-test-junit4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.7.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.7.0'
androidTestImplementation 'androidx.test.ext:junit:1.3.0' androidTestImplementation 'androidx.test.ext:junit:1.3.0'
@@ -5,7 +5,7 @@ include(FetchContent)
# Sets the minimum version of CMake required to build the native library. # Sets the minimum version of CMake required to build the native library.
cmake_minimum_required(VERSION 3.22.1) cmake_minimum_required(VERSION 3.31.5)
# Declares and names the project. # Declares and names the project.
@@ -17,7 +17,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
FetchContent_Declare( FetchContent_Declare(
adrenotools adrenotools
GIT_REPOSITORY https://github.com/bylaws/libadrenotools.git GIT_REPOSITORY https://github.com/bylaws/libadrenotools.git
GIT_TAG deec5f75ee1a8ccbe32c8780b1d17284fc87b0f1 # v1.0-14-gdeec5f7 GIT_TAG 8fae8ce254dfc1344527e05301e43f37dea2df80
) )
FetchContent_MakeAvailable(adrenotools) FetchContent_MakeAvailable(adrenotools)
@@ -71,11 +71,10 @@ cmake_path(ABSOLUTE_PATH JNI_PATH NORMALIZE)
cmake_path(APPEND JNI_PATH libcrypto.so OUTPUT_VARIABLE LIBCRYPTO_JNI_PATH) cmake_path(APPEND JNI_PATH libcrypto.so OUTPUT_VARIABLE LIBCRYPTO_JNI_PATH)
cmake_path(APPEND JNI_PATH libssl.so OUTPUT_VARIABLE LIBSSL_JNI_PATH) cmake_path(APPEND JNI_PATH libssl.so OUTPUT_VARIABLE LIBSSL_JNI_PATH)
# Add OpenAL # Add OpenAL
add_subdirectory(libraries/openal) add_subdirectory(libraries/openal)
set_target_properties(OpenAL PROPERTIES set_target_properties(OpenAL PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${JNI_PATH} LIBRARY_OUTPUT_DIRECTORY ${JNI_PATH}
ARCHIVE_OUTPUT_DIRECTORY ${JNI_PATH} ARCHIVE_OUTPUT_DIRECTORY ${JNI_PATH}
RUNTIME_OUTPUT_DIRECTORY ${JNI_PATH} RUNTIME_OUTPUT_DIRECTORY ${JNI_PATH}
) )
@@ -32,7 +32,7 @@ Java_org_kenjinx_android_NativeHelpers_getNativeWindow(
jobject instance, jobject instance,
jobject surface) { jobject surface) {
auto nativeWindow = ANativeWindow_fromSurface(env, surface); auto nativeWindow = ANativeWindow_fromSurface(env, surface);
return nativeWindow == NULL ? -1 : (jlong) nativeWindow; return nativeWindow == nullptr ? -1 : (jlong) nativeWindow;
} }
JNIEXPORT void JNICALL JNIEXPORT void JNICALL
@@ -42,7 +42,7 @@ Java_org_kenjinx_android_NativeHelpers_releaseNativeWindow(
jlong window) { jlong window) {
auto nativeWindow = (ANativeWindow *) window; auto nativeWindow = (ANativeWindow *) window;
if (nativeWindow != NULL) if (nativeWindow != nullptr)
ANativeWindow_release(nativeWindow); ANativeWindow_release(nativeWindow);
} }
@@ -75,7 +75,7 @@ Java_org_kenjinx_android_NativeHelpers_getCreateSurfacePtr(
char *getStringPointer( char *getStringPointer(
JNIEnv *env, JNIEnv *env,
jstring jS) { jstring jS) {
const char *cparam = env->GetStringUTFChars(jS, 0); const char *cparam = env->GetStringUTFChars(jS, nullptr);
auto len = env->GetStringUTFLength(jS); auto len = env->GetStringUTFLength(jS);
char *s = new char[len + 1]; //null terminator char *s = new char[len + 1]; //null terminator
strcpy(s, cparam); strcpy(s, cparam);
@@ -6,12 +6,12 @@
#define KENJINXNATIVE_KENJINX_H #define KENJINXNATIVE_KENJINX_H
#include <cassert> #include <cassert>
#include <cstdlib>
#include <cstring>
#include <dlfcn.h> #include <dlfcn.h>
#include <exception> #include <exception>
#include <fcntl.h> #include <fcntl.h>
#include <jni.h> #include <jni.h>
#include <stdlib.h>
#include <string.h>
#include <string> #include <string>
#include <android/log.h> #include <android/log.h>
+4 -4
View File
@@ -3,8 +3,8 @@ pluginManagement {
google() google()
mavenCentral() mavenCentral()
gradlePluginPortal() gradlePluginPortal()
maven { url 'https://jitpack.io' } maven { url = 'https://jitpack.io' }
maven { url "https://maven.pkg.jetbrains.space/public/p/compose/dev" } maven { url = "https://maven.pkg.jetbrains.space/public/p/compose/dev" }
} }
} }
dependencyResolutionManagement { dependencyResolutionManagement {
@@ -12,8 +12,8 @@ dependencyResolutionManagement {
repositories { repositories {
google() google()
mavenCentral() mavenCentral()
maven { url 'https://jitpack.io' } maven { url = 'https://jitpack.io' }
maven { url "https://maven.pkg.jetbrains.space/public/p/compose/dev" } maven { url = "https://maven.pkg.jetbrains.space/public/p/compose/dev" }
} }
} }
rootProject.name = "KenjinxAndroid" rootProject.name = "KenjinxAndroid"