tools: allow -x86_64 and -x86_32 as command line flags to select those architectures instead of defaults (closes #1819)

Still supports -32 and -64, though, for backwards compatibility. We could consider removing those in Lime 9.
This commit is contained in:
Josh Tynjala
2024-07-19 14:46:44 -07:00
parent 745c178908
commit b866632a6f
5 changed files with 16 additions and 15 deletions

View File

@@ -120,7 +120,7 @@ class LinuxPlatform extends PlatformTarget
for (architecture in project.architectures)
{
if (!targetFlags.exists("32") && architecture == Architecture.X64)
if (!targetFlags.exists("32") && !targetFlags.exists("x86_32") && architecture == Architecture.X64)
{
is64 = true;
}
@@ -507,12 +507,12 @@ class LinuxPlatform extends PlatformTarget
}
else
{
if (!targetFlags.exists("32") && System.hostArchitecture == X64)
if (!targetFlags.exists("32") && !targetFlags.exists("x86_32") && System.hostArchitecture == X64)
{
commands.push(["-Dlinux", "-DHXCPP_M64"]);
}
if (!targetFlags.exists("64") && (command == "rebuild" || System.hostArchitecture == X86))
if (!targetFlags.exists("64") && !targetFlags.exists("x86_64") && (command == "rebuild" || System.hostArchitecture == X86))
{
commands.push(["-Dlinux", "-DHXCPP_M32"]);
}

View File

@@ -427,7 +427,7 @@ class MacPlatform extends PlatformTarget
{
commands.push(["-Dmac", "-DHXCPP_CLANG", "-DHXCPP_ARM64"]);
}
else if (!targetFlags.exists("32"))
else if (!targetFlags.exists("32") && !targetFlags.exists("x86_32"))
{
commands.push(["-Dmac", "-DHXCPP_CLANG", "-DHXCPP_M64"]);
}
@@ -443,7 +443,7 @@ class MacPlatform extends PlatformTarget
// hashlink doesn't support arm64 macs yet
commands.push(["-Dmac", "-DHXCPP_CLANG", "-DHXCPP_ARCH=x86_64", "-Dhashlink"]);
}
else if (targetFlags.exists("64"))
else if (targetFlags.exists("64") || targetFlags.exists("x86_64"))
{
commands.push(["-Dmac", "-DHXCPP_CLANG", "-DHXCPP_ARCH=x86_64"]);
}

View File

@@ -145,7 +145,7 @@ class WindowsPlatform extends PlatformTarget
else if (project.targetFlags.exists("hl") || targetFlags.exists("hlc"))
{
targetType = "hl";
is64 = !project.flags.exists("32");
is64 = !project.flags.exists("32") && !project.flags.exists("x86_32");
}
else if (project.targetFlags.exists("cppia"))
{
@@ -737,7 +737,8 @@ class WindowsPlatform extends PlatformTarget
if (targetType == "hl")
{
// default to 64 bit, just like upstream Hashlink releases
if (!targetFlags.exists("32") && (System.hostArchitecture == X64 || targetFlags.exists("64")))
if (!targetFlags.exists("32") && !targetFlags.exists("x86_32")
&& (System.hostArchitecture == X64 || targetFlags.exists("64") || targetFlags.exists("x86_64")))
{
commands.push(["-Dwindows", "-DHXCPP_M64", "-Dhashlink"]);
}
@@ -748,7 +749,7 @@ class WindowsPlatform extends PlatformTarget
}
else
{
if (!targetFlags.exists("64")
if (!targetFlags.exists("64") && !targetFlags.exists("x86_64")
&& (command == "rebuild" || System.hostArchitecture == X86 || (targetType != "cpp" && targetType != "winrt")))
{
if (targetType == "winrt")
@@ -765,7 +766,7 @@ class WindowsPlatform extends PlatformTarget
// as previous Windows builds. For now, force -64 to be done last
// so that it can be debugged in a default "rebuild"
if (!targetFlags.exists("32")
if (!targetFlags.exists("32") && !targetFlags.exists("x86_32")
&& System.hostArchitecture == X64
&& (command != "rebuild" || targetType == "cpp" || targetType == "winrt"))
{