Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check HXCPP_ARCH before defaulting to host arch #1122

Merged
merged 2 commits into from
Jun 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions tools/hxcpp/BuildTool.hx
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,23 @@ class BuildTool
var otherArmArchitecture = mDefines.exists("HXCPP_ARMV6") || mDefines.exists("HXCPP_ARMV7") || mDefines.exists("HXCPP_ARMV7S");
if (m64==m32 && !arm64 && !otherArmArchitecture)
{
var arch = getArch();
var arch = mDefines.get("HXCPP_ARCH");
if (arch!=null)
{
m64 = arch=="x86_64";
m32 = arch=="x86";
arm64 = arch=="arm64";
}
else
{
var hostArch = getArch();

// Default to the current OS version. windowsArm runs m32 code too
m64 = hostArch=="m64";
m32 = hostArch=="m32";
arm64 = hostArch=="arm64";
}

// Default to the current OS version. windowsArm runs m32 code too
m64 = arch=="m64";
m32 = arch=="m32";
arm64 = arch=="arm64";
mDefines.remove(m32 ? "HXCPP_M64" : "HXCPP_M32");
set64(mDefines,m64,arm64);
}
Expand Down