Skip to content

Commit f3f342d

Browse files
authored
[tools] Fix bindir for arm64 cppia (#1323)
* [tools] Fix cppia bindir for arm64 * [tools] Fix BINDIR for arm64 linux
1 parent 4cc1828 commit f3f342d

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

tools/hxcpp/BuildTool.hx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1632,15 +1632,16 @@ class BuildTool
16321632

16331633
if (args.length>0 && args[0].endsWith(".cppia"))
16341634
{
1635-
var binDir = isWindows ? "Windows" : isMac ? "Mac64" : isLinux ? "Linux64" : null;
1636-
if (binDir==null)
1635+
var hostName = isWindows ? "Windows" : isMac ? "Mac" : isLinux ? "Linux" : null;
1636+
if (hostName==null)
16371637
Log.error("Cppia is not supported on this host.");
1638-
var arch = getArch();
1639-
var binDir = isWindows ? (isWindowsArm ? "WindowsArm64" : "Windows64" ) :
1640-
isMac ? "Mac64" :
1641-
isLinux ? ("Linux64") :
1642-
null;
1643-
var exe = '$HXCPP/bin/$binDir/Cppia' + (isWindows ? ".exe" : "");
1638+
var archSuffix = switch getArch() {
1639+
case 'arm64': 'Arm64';
1640+
case 'm64': '64';
1641+
case 'm32': '';
1642+
case _: return Log.error("Unsupported host architecture");
1643+
};
1644+
var exe = '$HXCPP/bin/$hostName$archSuffix/Cppia' + (isWindows ? ".exe" : "");
16441645
if (!isWindows)
16451646
{
16461647
var phase = "find";
@@ -2140,7 +2141,7 @@ class BuildTool
21402141
defines.set("HXCPP_ARM64","1");
21412142
m64 = true;
21422143
}
2143-
defines.set("BINDIR", m64 ? "Linux64":"Linux");
2144+
defines.set("BINDIR", arm64 ? "LinuxArm64" : m64 ? "Linux64":"Linux");
21442145
}
21452146
}
21462147
else if ( (new EReg("mac","i")).match(os) )
@@ -2153,7 +2154,7 @@ class BuildTool
21532154
defines.set("linux","linux");
21542155
defines.set("toolchain","linux");
21552156
defines.set("xcompile","1");
2156-
defines.set("BINDIR", m64 ? "Linux64":"Linux");
2157+
defines.set("BINDIR", arm64 ? "LinuxArm64" : m64 ? "Linux64":"Linux");
21572158
}
21582159
else
21592160
{

0 commit comments

Comments
 (0)