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 {
namespace 'org.kenjinx.android'
namespace = 'org.kenjinx.android'
compileSdk 36
defaultConfig {
applicationId "org.kenjinx.android"
minSdk 29
//noinspection EditedTargetSdkVersion
targetSdk 36
versionCode 20005
versionName '2.0.5'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary true
}
ndk {
//noinspection ChromeOsAbiSupport
@@ -27,10 +23,11 @@ android {
externalNativeBuild {
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",
"-DCMAKE_BUILD_TYPE=Release",
"-DANDROID_ARM_NEON=TRUE"
"-DANDROID_ARM_NEON=TRUE",
"-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON"
}
}
}
@@ -39,25 +36,29 @@ android {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.debug
signingConfig = signingConfigs.debug
debuggable false
jniDebuggable false
}
}
androidComponents {
onVariants(selector().withBuildType("release")) {
packaging.dex.useLegacyPackaging.set(true)
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_21
targetCompatibility JavaVersion.VERSION_21
}
buildFeatures {
compose true
prefab true
buildConfig true
compose = true
prefab = true
buildConfig = true
}
packagingOptions {
jniLibs {
keepDebugSymbols += '**/libkenjinx.so'
@@ -67,9 +68,11 @@ android {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
}
}
externalNativeBuild {
cmake {
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-core:1.10.2'
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.test.espresso:espresso-core:3.7.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.
cmake_minimum_required(VERSION 3.22.1)
cmake_minimum_required(VERSION 3.31.5)
# Declares and names the project.
@@ -17,7 +17,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
FetchContent_Declare(
adrenotools
GIT_REPOSITORY https://github.com/bylaws/libadrenotools.git
GIT_TAG deec5f75ee1a8ccbe32c8780b1d17284fc87b0f1 # v1.0-14-gdeec5f7
GIT_TAG 8fae8ce254dfc1344527e05301e43f37dea2df80
)
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 libssl.so OUTPUT_VARIABLE LIBSSL_JNI_PATH)
# Add OpenAL
add_subdirectory(libraries/openal)
set_target_properties(OpenAL PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${JNI_PATH}
ARCHIVE_OUTPUT_DIRECTORY ${JNI_PATH}
RUNTIME_OUTPUT_DIRECTORY ${JNI_PATH}
)
)
@@ -32,7 +32,7 @@ Java_org_kenjinx_android_NativeHelpers_getNativeWindow(
jobject instance,
jobject surface) {
auto nativeWindow = ANativeWindow_fromSurface(env, surface);
return nativeWindow == NULL ? -1 : (jlong) nativeWindow;
return nativeWindow == nullptr ? -1 : (jlong) nativeWindow;
}
JNIEXPORT void JNICALL
@@ -42,7 +42,7 @@ Java_org_kenjinx_android_NativeHelpers_releaseNativeWindow(
jlong window) {
auto nativeWindow = (ANativeWindow *) window;
if (nativeWindow != NULL)
if (nativeWindow != nullptr)
ANativeWindow_release(nativeWindow);
}
@@ -75,7 +75,7 @@ Java_org_kenjinx_android_NativeHelpers_getCreateSurfacePtr(
char *getStringPointer(
JNIEnv *env,
jstring jS) {
const char *cparam = env->GetStringUTFChars(jS, 0);
const char *cparam = env->GetStringUTFChars(jS, nullptr);
auto len = env->GetStringUTFLength(jS);
char *s = new char[len + 1]; //null terminator
strcpy(s, cparam);
@@ -6,12 +6,12 @@
#define KENJINXNATIVE_KENJINX_H
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <dlfcn.h>
#include <exception>
#include <fcntl.h>
#include <jni.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <android/log.h>
+4 -4
View File
@@ -3,8 +3,8 @@ pluginManagement {
google()
mavenCentral()
gradlePluginPortal()
maven { url 'https://jitpack.io' }
maven { url "https://maven.pkg.jetbrains.space/public/p/compose/dev" }
maven { url = 'https://jitpack.io' }
maven { url = "https://maven.pkg.jetbrains.space/public/p/compose/dev" }
}
}
dependencyResolutionManagement {
@@ -12,8 +12,8 @@ dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
maven { url "https://maven.pkg.jetbrains.space/public/p/compose/dev" }
maven { url = 'https://jitpack.io' }
maven { url = "https://maven.pkg.jetbrains.space/public/p/compose/dev" }
}
}
rootProject.name = "KenjinxAndroid"