aboutsummaryrefslogtreecommitdiffstats
path: root/share/qbs/modules/xcode/xcode.js
diff options
context:
space:
mode:
Diffstat (limited to 'share/qbs/modules/xcode/xcode.js')
-rw-r--r--share/qbs/modules/xcode/xcode.js16
1 files changed, 2 insertions, 14 deletions
diff --git a/share/qbs/modules/xcode/xcode.js b/share/qbs/modules/xcode/xcode.js
index bda41ade9..d20d9cf0c 100644
--- a/share/qbs/modules/xcode/xcode.js
+++ b/share/qbs/modules/xcode/xcode.js
@@ -114,7 +114,7 @@ function sdkInfoList(sdksPath) {
if (!plist || !plist["CanonicalName"] || !plist["Version"])
return false;
- var re = /^([0-9]+)\.([0-9]+)$/;
+ var re = /^[0-9]+\.[0-9]+(\.[0-9]+)?$/;
return plist["Version"].match(re);
}
@@ -132,19 +132,7 @@ function sdkInfoList(sdksPath) {
}
// Sort by SDK version number
- sdkInfo.sort(function (a, b) {
- var re = /^([0-9]+)\.([0-9]+)$/;
- a = a["Version"].match(re);
- if (a)
- a = {major: a[1], minor: a[2]};
- b = b["Version"].match(re);
- if (b)
- b = {major: b[1], minor: b[2]};
-
- if (a.major === b.major)
- return a.minor - b.minor;
- return a.major - b.major;
- });
+ sdkInfo.sort(function (a, b) { return Utilities.versionCompare(a["Version"], b["Version"]); });
return sdkInfo;
}