Skip to content

Commit eea2d0b

Browse files
committed
Fix android gradle file
1 parent 0cf9085 commit eea2d0b

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

armorcore/tools/make.js

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1983,33 +1983,33 @@ class AndroidExporter extends Exporter {
19831983
gradle = gradle.replace(/{compileSdkVersion}/g, target_options.compileSdkVersion.toString());
19841984
gradle = gradle.replace(/{minSdkVersion}/g, target_options.minSdkVersion.toString());
19851985
gradle = gradle.replace(/{targetSdkVersion}/g, target_options.targetSdkVersion.toString());
1986+
let arch = '';
1987+
if (target_options.abiFilters.length > 0) {
1988+
for (let item of target_options.abiFilters) {
1989+
if (arch.length === 0) {
1990+
arch = '"' + item + '"';
1991+
}
1992+
else {
1993+
arch = arch + ', "' + item + '"';
1994+
}
1995+
}
1996+
arch = `ndk { abiFilters += listOf(${arch}) }`;
1997+
}
1998+
else {
1999+
switch (goptions.arch) {
2000+
case 'default':
2001+
arch = '';
2002+
break;
2003+
case 'arm8':
2004+
arch = 'arm64-v8a';
2005+
break;
2006+
}
2007+
if (goptions.arch !== 'default') {
2008+
arch = `ndk {abiFilters += listOf("${arch}")}`;
2009+
}
2010+
}
2011+
gradle = gradle.replace(/{architecture}/g, arch);
19862012
// Looks like these should go into CMakeLists.txt now..
1987-
// let arch = '';
1988-
// if (target_options.abiFilters.length > 0) {
1989-
// for (let item of target_options.abiFilters) {
1990-
// if (arch.length === 0) {
1991-
// arch = '"' + item + '"';
1992-
// }
1993-
// else {
1994-
// arch = arch + ', "' + item + '"';
1995-
// }
1996-
// }
1997-
// arch = `ndk { abiFilters += listOf(${arch}) }`;
1998-
// }
1999-
// else {
2000-
// switch (goptions.arch) {
2001-
// case 'default':
2002-
// arch = '';
2003-
// break;
2004-
// case 'arm8':
2005-
// arch = 'arm64-v8a';
2006-
// break;
2007-
// }
2008-
// if (goptions.arch !== 'default') {
2009-
// arch = `ndk {abiFilters += listOf("${arch}")}`;
2010-
// }
2011-
// }
2012-
// gradle = gradle.replace(/{architecture}/g, arch);
20132013
// gradle = gradle.replace(/{cflags}/g, cflags);
20142014
// cppflags = '-frtti -fexceptions ' + cppflags;
20152015
// cppflags = '-std=' + project.cppStd + ' ' + cppflags;

0 commit comments

Comments
 (0)