From 0fc07d2943753f444f3eeccd9fb1dfde0938cb70 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 16 Jul 2018 13:24:51 +0200 Subject: Fix Xcode version check to work with major versions >= 10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- mkspecs/features/platform.prf | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3