diff options
Diffstat (limited to 'tools/qmake/mkspecs/features/functions.prf')
-rw-r--r-- | tools/qmake/mkspecs/features/functions.prf | 67 |
1 files changed, 60 insertions, 7 deletions
diff --git a/tools/qmake/mkspecs/features/functions.prf b/tools/qmake/mkspecs/features/functions.prf index 2fbbb1b42..c8fd278b4 100644 --- a/tools/qmake/mkspecs/features/functions.prf +++ b/tools/qmake/mkspecs/features/functions.prf @@ -19,9 +19,12 @@ defineTest(isPlatformSupported) { skipBuild("Qt WebEngine on Windows requires MSVC 2013 or MSVC 2015.") return(false) } + isBuildingOnWin32() { + skipBuild("Qt WebEngine on Windows must be built on a 64-bit machine.") + } } else:osx { - lessThan(QMAKE_XCODE_VERSION, 5.1) { - skipBuild("Using XCode version $$QMAKE_XCODE_VERSION, but at least version 5.1 is required to build Qt WebEngine.") + lessThan(QMAKE_XCODE_VERSION, 6.1) { + skipBuild("Using XCode version $$QMAKE_XCODE_VERSION, but at least version 6.1 is required to build Qt WebEngine.") return(false) } # We require OS X 10.9 (darwin version 13.0.0) or newer @@ -30,6 +33,10 @@ defineTest(isPlatformSupported) { skipBuild("Qt WebEngine requires OS X version 10.9 or newer.") return(false) } + !isMinOSXSDKVersion(10, 10): { + skipBuild("Qt WebEngine requires an OS X SDK version of 10.10 or newer. Current version is $${WEBENGINE_OSX_SDK_PRODUCT_VERSION}.") + return(false) + } } else { skipBuild("Unknown platform. Qt WebEngine only supports Linux, Windows, and OS X.") return(false) @@ -48,20 +55,34 @@ defineTest(isPlatformSupported) { return(false) } !isPythonVersionSupported(): return(false) + !isArchSupported(): return(false) return(true) } +defineTest(isArchSupported) { + contains(QT_ARCH, "i386")|contains(QT_ARCH, "x86_64"): return(true) + contains(QT_ARCH, "arm")|contains(QT_ARCH, "arm64"): return(true) + contains(QT_ARCH, "mips")|contains(QT_ARCH, "mips64"): return(true) + + skipBuild("QtWebEngine can only be built for x86, x86-64, ARM, Aarch64, MIPSel, and MIPS64 architectures.") + return(false) +} + defineTest(isPythonVersionSupported) { - python_error_msg = "Python version 2 (2.7 or later) is required to build Qt WebEngine." - python_major_version = $$system('python -c "import sys; print(sys.version_info[0])"') + python_error_msg = "Python version 2 (2.7.5 or later) is required to build Qt WebEngine." + python_version = $$system('python -c "import sys; print(sys.version_info[0:3])"') + python_version ~= s/[()]//g + python_version = $$split(python_version, ',') + python_major_version = $$first(python_version) greaterThan(python_major_version, 2) { skipBuild("Python version 3 is not supported by Chromium.") skipBuild($$python_error_msg) return(false) } - python_minor_version = $$system('python -c "import sys; print(sys.version_info[1])"') - greaterThan(python_major_version, 1): greaterThan(python_minor_version, 6): return(true) - skipBuild("Using Python version "$$python_major_version"."$$python_minor_version".") + python_minor_version = $$member(python_version, 1) + python_patch_version = $$member(python_version, 2) + greaterThan(python_major_version, 1): greaterThan(python_minor_version, 6): greaterThan(python_patch_version, 4): return(true) + skipBuild("Using Python version $${python_major_version}.$${python_minor_version}.$${python_patch_version}.") skipBuild($$python_error_msg) return(false) } @@ -81,6 +102,38 @@ defineTest(isQMLTestSupportApiEnabled) { return(false) } +defineTest(isBuildingOnWin32) { + # The check below is ugly, but necessary, as it seems to be the only reliable way to detect if the host + # architecture is 32 bit. QMAKE_HOST.arch does not work as it returns the architecture that the toolchain + # is building for, not the system's actual architecture. + PROGRAM_FILES_X86 = $$(ProgramW6432) + isEmpty(PROGRAM_FILES_X86): return(true) + return(false) +} + +defineTest(isMinOSXSDKVersion) { + requested_major = $$1 + requested_minor = $$2 + requested_patch = $$3 + isEmpty(requested_patch): requested_patch = 0 + WEBENGINE_OSX_SDK_PRODUCT_VERSION = $$system("/usr/bin/xcodebuild -sdk $$QMAKE_MAC_SDK -version ProductVersion 2>/dev/null") + export(WEBENGINE_OSX_SDK_PRODUCT_VERSION) + isEmpty(WEBENGINE_OSX_SDK_PRODUCT_VERSION) { + skipBuild("Could not resolve SDK product version for \'$$QMAKE_MAC_SDK\'.") + return(false) + } + major_version = $$section(WEBENGINE_OSX_SDK_PRODUCT_VERSION, ., 0, 0) + minor_version = $$section(WEBENGINE_OSX_SDK_PRODUCT_VERSION, ., 1, 1) + patch_version = $$section(WEBENGINE_OSX_SDK_PRODUCT_VERSION, ., 2, 2) + 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) +} + # Map to the correct target type for gyp defineReplace(toGypTargetType) { equals(TEMPLATE, "app"):return("executable") |