diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2018-07-16 13:24:51 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2018-09-28 14:49:50 +0000 |
commit | 9bc7fd3ad241daf464fe065667ded711fdaee160 (patch) | |
tree | d9b66b13a34b9da7ce1b87cb8970d07dd520acb8 /mkspecs | |
parent | e3443068ae5b88a80539db81e56ecc6702ac2817 (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>
(cherry picked from commit 0fc07d2943753f444f3eeccd9fb1dfde0938cb70)
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'mkspecs')
-rw-r--r-- | mkspecs/features/functions.prf | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/mkspecs/features/functions.prf b/mkspecs/features/functions.prf index b78d2a112..ac0c98374 100644 --- a/mkspecs/features/functions.prf +++ b/mkspecs/features/functions.prf @@ -38,7 +38,7 @@ defineTest(isPlatformSupported) { return(false) } } else:osx { - lessThan(QMAKE_XCODE_VERSION, 5.1) { + !isMinXcodeVersion(5, 1) { skipBuild("Using XCode version $$QMAKE_XCODE_VERSION, but at least version 5.1 is required to build Qt WebEngine.") return(false) } @@ -241,6 +241,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 |