From eea2d0bdd93ddf305dc18a0570bc041f1d914dc1 Mon Sep 17 00:00:00 2001 From: luboslenco Date: Tue, 12 Nov 2024 19:09:35 +0100 Subject: [PATCH] Fix android gradle file --- armorcore/tools/make.js | 52 ++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/armorcore/tools/make.js b/armorcore/tools/make.js index 53ed30ac..1bf4a0a8 100644 --- a/armorcore/tools/make.js +++ b/armorcore/tools/make.js @@ -1983,33 +1983,33 @@ class AndroidExporter extends Exporter { gradle = gradle.replace(/{compileSdkVersion}/g, target_options.compileSdkVersion.toString()); gradle = gradle.replace(/{minSdkVersion}/g, target_options.minSdkVersion.toString()); gradle = gradle.replace(/{targetSdkVersion}/g, target_options.targetSdkVersion.toString()); + let arch = ''; + if (target_options.abiFilters.length > 0) { + for (let item of target_options.abiFilters) { + if (arch.length === 0) { + arch = '"' + item + '"'; + } + else { + arch = arch + ', "' + item + '"'; + } + } + arch = `ndk { abiFilters += listOf(${arch}) }`; + } + else { + switch (goptions.arch) { + case 'default': + arch = ''; + break; + case 'arm8': + arch = 'arm64-v8a'; + break; + } + if (goptions.arch !== 'default') { + arch = `ndk {abiFilters += listOf("${arch}")}`; + } + } + gradle = gradle.replace(/{architecture}/g, arch); // Looks like these should go into CMakeLists.txt now.. - // let arch = ''; - // if (target_options.abiFilters.length > 0) { - // for (let item of target_options.abiFilters) { - // if (arch.length === 0) { - // arch = '"' + item + '"'; - // } - // else { - // arch = arch + ', "' + item + '"'; - // } - // } - // arch = `ndk { abiFilters += listOf(${arch}) }`; - // } - // else { - // switch (goptions.arch) { - // case 'default': - // arch = ''; - // break; - // case 'arm8': - // arch = 'arm64-v8a'; - // break; - // } - // if (goptions.arch !== 'default') { - // arch = `ndk {abiFilters += listOf("${arch}")}`; - // } - // } - // gradle = gradle.replace(/{architecture}/g, arch); // gradle = gradle.replace(/{cflags}/g, cflags); // cppflags = '-frtti -fexceptions ' + cppflags; // cppflags = '-std=' + project.cppStd + ' ' + cppflags;