Skip to content

Commit a287617

Browse files
joshtynjalabob-jones-cs
authored andcommitted
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 9b5b91d commit a287617

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

tools/hxcpp/BuildTool.hx

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

0 commit comments

Comments
 (0)