Skip to content

Commit

Permalink
Do not use SIMD on android simulator. Allow only single arch when bui…
Browse files Browse the repository at this point in the history
…lding for android
  • Loading branch information
Hugh Sanderson committed Sep 22, 2024
1 parent a6ce918 commit e31e220
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
1 change: 1 addition & 0 deletions acadnme/build.nmml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
<haxedef name="scriptable" />
<haxedef name="NME_ANGLE" if="windows" />
<haxedef name="HXCPP_M64" if="windows" />
<unset name="no_haxe_http" if="wasm" />
<engine name="Acadnme" version="6.0" />
<haxedef name="HXCPP_LINK_TOTAL_MEMORY" value="32000000"/>
<haxeflag name="-dce no" />
Expand Down
17 changes: 10 additions & 7 deletions project/ToolkitBuild.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,16 @@
<set name="NME_SIMD_D" value="-DNME_SIMD_ARM7" />
<set name="NME_SIMD_ARM7" value="1" />
</section>
<section if="HXCPP_M64" unless="NME_SIMD_D">
<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" />

<section unless="android">
<section if="HXCPP_M64" unless="NME_SIMD_D">
<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" />
</section>
</section>


Expand Down
13 changes: 13 additions & 0 deletions tools/nme/src/platforms/AndroidPlatform.hx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,19 @@ class AndroidPlatform extends Platform
else if(project.androidConfig.ABIs.length == 0)
{
project.androidConfig.ABIs = ["armeabi-v7a", "arm64-v8a", "x86", "x86_64"];
var explicitArch = [ "HXCPP_ARMV7", "HXCPP_ARM64", "HXCPP_X86", "HXCPP_X86_64" ];
var hasDef = false;
for( e in explicitArch)
if (project.hasDef(e))
hasDef = true;
if (hasDef)
{
var filtered = [];
for(i in 0...explicitArch.length)
if (project.hasDef(explicitArch[i]))
filtered.push( project.androidConfig.ABIs[i]);
project.androidConfig.ABIs = filtered;
}
}

project.architectures = [for(abi in project.androidConfig.ABIs) findArchitectureByName(abi)];
Expand Down

0 comments on commit e31e220

Please sign in to comment.