summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2018-07-16 13:24:51 +0200
committerKai Koehne <kai.koehne@qt.io>2018-07-23 12:11:17 +0000
commit0fc07d2943753f444f3eeccd9fb1dfde0938cb70 (patch)
tree85daf1d425d697700e34df5be9f61ee4656f2c7a
parent38952ec359423a060d9e2f500f2d9eba2336f532 (diff)
Fix Xcode version check to work with major versions >= 10
We used lessThan for the Xcode version check, which started to fail when comparing Xcode 10 with Xcode 7.3, because lessThan first tries to convert the arguments to ints and if that fails, it does string comparison instead. Rewrite the code to be similar to the SDK checks. We can't use the qmake versionAtLeast function because it was added in Qt 5.10, and we still need to be able to build against Qt 5.9. Task-number: QTBUG-69476 Change-Id: I831a683ee676838a4d531a4d6e715182e9e4193d Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
-rw-r--r--mkspecs/features/platform.prf22
1 files changed, 21 insertions, 1 deletions
diff --git a/mkspecs/features/platform.prf b/mkspecs/features/platform.prf
index 614f7fc92..c790c9fa6 100644
--- a/mkspecs/features/platform.prf
+++ b/mkspecs/features/platform.prf
@@ -38,7 +38,7 @@ defineTest(isPlatformSupported) {
return(false)
}
} else:osx {
- lessThan(QMAKE_XCODE_VERSION, 7.3) {
+ !isMinXcodeVersion(7, 3) {
skipBuild("Using Xcode version $$QMAKE_XCODE_VERSION, but at least version 7.3 is required to build Qt WebEngine.")
return(false)
}
@@ -127,6 +127,26 @@ defineTest(isMinOSXSDKVersion) {
return(false)
}
+defineTest(isMinXcodeVersion) {
+ requested_major = $$1
+ requested_minor = $$2
+ requested_patch = $$3
+ isEmpty(requested_minor): requested_minor = 0
+ isEmpty(requested_patch): requested_patch = 0
+ target_var = QMAKE_XCODE_VERSION
+ major_version = $$section($$target_var, ., 0, 0)
+ minor_version = $$section($$target_var, ., 1, 1)
+ patch_version = $$section($$target_var, ., 2, 2)
+ isEmpty(minor_version): minor_version = 0
+ isEmpty(patch_version): patch_version = 0
+
+ greaterThan(major_version, $$requested_major):return(true)
+ equals(major_version, $$requested_major):greaterThan(minor_version, $$requested_minor):return(true)
+ equals(major_version, $$requested_major):equals(minor_version, $$requested_minor):!lessThan(patch_version, $$requested_patch):return(true)
+
+ return(false)
+}
+
defineTest(isMinWinSDKVersion) {
requested_major = $$1
requested_minor = $$2