--- tools/qmake/mkspecs/features/functions.prf.orig	2016-11-30 20:08:16.000000000 -0800
+++ tools/qmake/mkspecs/features/functions.prf	2018-10-20 08:40:47.000000000 -0700
@@ -23,7 +23,7 @@
       skipBuild("Qt WebEngine on Windows must be built on a 64-bit machine.")
     }
   } else:osx {
-    lessThan(QMAKE_XCODE_VERSION, 6.1) {
+    !isMinXcodeVersion(6, 1) {
       skipBuild("Using XCode version $$QMAKE_XCODE_VERSION, but at least version 6.1 is required to build Qt WebEngine.")
       return(false)
     }
@@ -111,6 +111,26 @@
     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(isMinOSXSDKVersion) {
     requested_major = $$1
     requested_minor = $$2