Skip to content

Commit ceb6914

Browse files
committed
BuildTool: Fix xcodebuild: error: SDK macosx26 cannot be located.
My SDKs directory contains three entries: MacOSX.sdk MacOSX26.0.sdk MacOSX26.sdk The current SDK version detection in hxcpp is preferring MacOSX26.sdk over MacOSX26.0.sdk. This is causing MACOSX_VER to be set to 26. However, xcodebuild seems to want both major and minor parts of the version to be specified, so MACOSX_VER should be set to 26.0 instead. This change checks if the current best's minor version is parsed as NaN when the major versions match, which results in a real float value for the minor version to be preferred.
1 parent 1618253 commit ceb6914

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tools/hxcpp/BuildTool.hx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2205,7 +2205,13 @@ class BuildTool
22052205
var ver = extract_version.matched(1);
22062206
var split_best = best.split(".");
22072207
var split_ver = ver.split(".");
2208-
if (Std.parseFloat(split_ver[0]) > Std.parseFloat(split_best[0]) || Std.parseFloat(split_ver[1]) > Std.parseFloat(split_best[1]))
2208+
var major_ver = Std.parseFloat(split_ver[0]);
2209+
var minor_ver = Std.parseFloat(split_ver[1]);
2210+
var major_best = Std.parseFloat(split_best[0]);
2211+
var minor_best = Std.parseFloat(split_best[1]);
2212+
if (major_ver == major_best && Math.isNaN(minor_best))
2213+
best = ver;
2214+
else if (major_ver > major_best || minor_ver > minor_best)
22092215
best = ver;
22102216
}
22112217
}

0 commit comments

Comments
 (0)