Skip to content

Commit

Permalink
Base libpng on ARMV7 not ARM7. Add 'set' debug option
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugh Sanderson committed Oct 6, 2024
1 parent bec66f0 commit fd894f6
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 27 deletions.
4 changes: 3 additions & 1 deletion project/ToolkitBuild.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
<set name="NME_SIMD_D" value="-DNME_SIMD_ARM64" />
<set name="NME_SIMD_ARM64" value="1" />
</section>
<section if="HXCPP_ARM7" unless="NME_SIMD_D">

<section if="HXCPP_ARMV7" unless="NME_SIMD_D">
<set name="NME_SIMD_D" value="-DNME_SIMD_ARM7" />
<set name="NME_SIMD_ARM7" value="1" />
</section>
Expand All @@ -62,6 +63,7 @@
<set name="NME_SIMD_D" value="-DNME_SIMD_X86_64" />
<set name="NME_SIMD_X86_64" value="1" />
</section>

<section if="HXCPP_M32 windows" unless="NME_SIMD_D">
<set name="NME_SIMD_D" value="-DNME_SIMD_X86" />
<set name="NME_SIMD_X86" value="1" />
Expand Down
4 changes: 2 additions & 2 deletions samples/DisplayingABitmap/project.nmml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@

<assets path="Assets" rename="assets" exclude="nme.svg" />
<icon path="Assets/nme.svg" />
</project>

</project>
17 changes: 13 additions & 4 deletions tools/nme/src/CommandLineTools.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1435,6 +1435,11 @@ class CommandLineTools
sys.println("");
}

if (project.architectures!=null)
{
Log.verbose("Using specified architectures:" + project.architectures );
}

switch(command)
{
case "":
Expand Down Expand Up @@ -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);
Expand Down
13 changes: 9 additions & 4 deletions tools/nme/src/platforms/AndroidPlatform.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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" ];
Expand All @@ -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)
Expand Down
47 changes: 31 additions & 16 deletions tools/nme/src/project/NMMLParser.hx
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,14 @@ class NMMLParser
project.templatePaths.push(path);
}
}


function dumpVars(title:String, values:Map<String,String>)
{
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)
Expand All @@ -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":

Expand Down

0 comments on commit fd894f6

Please sign in to comment.