File tree Expand file tree Collapse file tree 2 files changed +22
-7
lines changed
Expand file tree Collapse file tree 2 files changed +22
-7
lines changed Original file line number Diff line number Diff line change 11<xml >
22
3- <section unless =" HXCPP_ANDROID_PLATFORM" >
4- <set name =" HXCPP_ANDROID_PLATFORM" value =" 16" />
5- <set name =" HXCPP_ANDROID_PLATFORM" value =" 19" if =" NDKV24+" />
6- <!-- 64 bit builds fail unless using platform 21 -->
7- <set name =" HXCPP_ANDROID_PLATFORM" value =" 21" if =" NDKV26+||HXCPP_X86_64||HXCPP_ARM64" />
8- </section >
9-
103<!-- Set architecture -->
114<section if =" HXCPP_X86" >
125 <set name =" ARCH" value =" -x86" />
Original file line number Diff line number Diff line change @@ -523,6 +523,28 @@ class Setup
523523 if (defines .exists (" PLATFORM_NUMBER" )) {
524524 Log .warn (" The PLATFORM_NUMBER define is deprecated. Please use the HXCPP_ANDROID_PLATFORM define instead." );
525525 defines .set (" HXCPP_ANDROID_PLATFORM" , Std .string (defines .get (" PLATFORM_NUMBER" )));
526+ } else {
527+ var platformsJson = root + " /meta/platforms.json" ;
528+
529+ var minPlatform : Null <Int > = try {
530+ haxe. Json .parse (sys.io. File .getContent (platformsJson )).min ;
531+ } catch (e ) {
532+ Log .warn (" Unable to determine minimum supported Android platform: " + e .toString ());
533+ null ;
534+ };
535+
536+ if (minPlatform == null ) {
537+ Log .warn (" Defaulting to Android platform 21" );
538+ minPlatform = 21 ;
539+ }
540+
541+ // only platform version 21 and above support 64 bit
542+ // https://developer.android.com/about/versions/lollipop#Perf
543+ if (minPlatform < 21 && (defines .exists (' HXCPP_ARM64' ) || defines .exists (' HXCPP_X86_64' ))) {
544+ minPlatform = 21 ;
545+ }
546+
547+ defines .set (" HXCPP_ANDROID_PLATFORM" , Std .string (minPlatform ));
526548 }
527549 }
528550 else {
You can’t perform that action at this time.
0 commit comments