From fd894f6493569d478622c05e3d67df515cfa25b6 Mon Sep 17 00:00:00 2001 From: Hugh Sanderson Date: Sun, 6 Oct 2024 13:34:59 +0800 Subject: [PATCH] Base libpng on ARMV7 not ARM7. Add 'set' debug option --- project/ToolkitBuild.xml | 4 +- samples/DisplayingABitmap/project.nmml | 4 +- tools/nme/src/CommandLineTools.hx | 17 ++++++-- tools/nme/src/platforms/AndroidPlatform.hx | 13 ++++-- tools/nme/src/project/NMMLParser.hx | 47 ++++++++++++++-------- 5 files changed, 58 insertions(+), 27 deletions(-) diff --git a/project/ToolkitBuild.xml b/project/ToolkitBuild.xml index eb0b68b6f..48116b299 100644 --- a/project/ToolkitBuild.xml +++ b/project/ToolkitBuild.xml @@ -52,7 +52,8 @@ -
+ +
@@ -62,6 +63,7 @@
+
diff --git a/samples/DisplayingABitmap/project.nmml b/samples/DisplayingABitmap/project.nmml index c2e8803c7..d49af6c17 100644 --- a/samples/DisplayingABitmap/project.nmml +++ b/samples/DisplayingABitmap/project.nmml @@ -10,5 +10,5 @@ - - \ No newline at end of file + + diff --git a/tools/nme/src/CommandLineTools.hx b/tools/nme/src/CommandLineTools.hx index fc250d41b..fad38d8a1 100644 --- a/tools/nme/src/CommandLineTools.hx +++ b/tools/nme/src/CommandLineTools.hx @@ -1435,6 +1435,11 @@ class CommandLineTools sys.println(""); } + if (project.architectures!=null) + { + Log.verbose("Using specified architectures:" + project.architectures ); + } + switch(command) { case "": @@ -1720,13 +1725,17 @@ class CommandLineTools else if (argument == "-bin") binDirOverride = arguments[argIdx++]; - else if (argument.substr(0, 4) == "-arm") + else if (argument.substr(0, 4).toLowerCase() == "-arm") { var name = argument.substr(1).toUpperCase(); - var value = Type.createEnum(Architecture, name); - - if (value != null) + try { + var value = Type.createEnum(Architecture, name); project.architectures.push(value); + } + catch (e:Dynamic) + { + throw "Unkown arm specification, use on of -ARMV5 -ARMV6 -ARMV7 -ARM64 or -32, -64 for x86/x86_64"; + } } else if (argument == "-64") project.architectures.push(Architecture.X64); diff --git a/tools/nme/src/platforms/AndroidPlatform.hx b/tools/nme/src/platforms/AndroidPlatform.hx index 364548282..5168c6feb 100644 --- a/tools/nme/src/platforms/AndroidPlatform.hx +++ b/tools/nme/src/platforms/AndroidPlatform.hx @@ -97,7 +97,11 @@ class AndroidPlatform extends Platform Log.error("Could not determine build target from adb, and no test ABI specified"); } } - else if(project.androidConfig.ABIs.length == 0) + else if (project.architectures.length>0) + { + // Ok, use explicit list + } + else if (project.androidConfig.ABIs.length == 0 && project.architectures.length==0) { project.androidConfig.ABIs = ["armeabi-v7a", "arm64-v8a", "x86", "x86_64"]; var explicitArch = [ "HXCPP_ARMV7", "HXCPP_ARM64", "HXCPP_X86", "HXCPP_X86_64" ]; @@ -115,10 +119,11 @@ class AndroidPlatform extends Platform } } - project.architectures = [for(abi in project.androidConfig.ABIs) findArchitectureByName(abi)]; - + if (project.architectures.length==0) + project.architectures = [for(abi in project.androidConfig.ABIs) findArchitectureByName(abi)]; + Log.verbose("Valid archs: " + project.architectures ); - + var libDir = getOutputLibDir(); for(abi in abis) if (project.architectures.indexOf(abi.architecture) == -1) diff --git a/tools/nme/src/project/NMMLParser.hx b/tools/nme/src/project/NMMLParser.hx index 413538d79..fd679188f 100644 --- a/tools/nme/src/project/NMMLParser.hx +++ b/tools/nme/src/project/NMMLParser.hx @@ -684,7 +684,14 @@ class NMMLParser project.templatePaths.push(path); } } - + + function dumpVars(title:String, values:Map) + { + Sys.println(title); + for(k in values.keys()) + Sys.println(" " + k + "=" + values.get(k) ); + } + private function parseSequentially(xml:Access, section:String, extensionPath:String, inWarnUnknown):Void { for(element in xml.elements) @@ -695,25 +702,33 @@ class NMMLParser switch(element.name) { case "set": - - var name = element.att.name; - var value = ""; - - if (element.has.value) + if (!element.has.name) { - value = substitute(element.att.value); + dumpVars("HaxeDefs",project.haxedefs); + dumpVars("LocalDefs",project.localDefines); + dumpVars("Environment",project.environment); } - - switch(name) + else { - case "BUILD_DIR": project.app.binDir = value; - case "SWF_VERSION": project.app.swfVersion = Std.parseFloat(value); - case "PRERENDERED_ICON": project.iosConfig.prerenderedIcon = (value == "true"); - case "ANDROID_INSTALL_LOCATION": project.androidConfig.installLocation = value; - } + var name = element.att.name; + var value = ""; - project.localDefines.set(name, value); - project.environment.set(name, value); + if (element.has.value) + { + value = substitute(element.att.value); + } + + switch(name) + { + case "BUILD_DIR": project.app.binDir = value; + case "SWF_VERSION": project.app.swfVersion = Std.parseFloat(value); + case "PRERENDERED_ICON": project.iosConfig.prerenderedIcon = (value == "true"); + case "ANDROID_INSTALL_LOCATION": project.androidConfig.installLocation = value; + } + + project.localDefines.set(name, value); + project.environment.set(name, value); + } case "unset":