diff options
Diffstat (limited to 'tools/qmake/mkspecs/features/functions.prf')
-rw-r--r-- | tools/qmake/mkspecs/features/functions.prf | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/tools/qmake/mkspecs/features/functions.prf b/tools/qmake/mkspecs/features/functions.prf index ed1133037..eb421f8b5 100644 --- a/tools/qmake/mkspecs/features/functions.prf +++ b/tools/qmake/mkspecs/features/functions.prf @@ -86,7 +86,6 @@ defineTest(isPlatformSupported) { skipBuild("Static builds of QtWebEngine aren't supported.") return(false) } - !isPythonVersionSupported(): return(false) !isArchSupported(): return(false) isSanitizerEnabled():!isSanitizerSupported():!forceSanitizerBuild(): return(false) return(true) @@ -101,25 +100,6 @@ defineTest(isArchSupported) { return(false) } -defineTest(isPythonVersionSupported) { - 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 = $$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) -} - defineTest(isSanitizerEnabled) { sanitize_address|sanitize_memory|sanitize_undefined|sanitize_thread: return(true) return(false) @@ -358,6 +338,25 @@ defineTest(use?) { return(false) } +# Returns the unquoted path to the python executable. +defineReplace(pythonPath) { + isEmpty(QMAKE_PYTHON2) { + # Fallback for building QtWebEngine with Qt < 5.8 + QMAKE_PYTHON2 = python + } + return($$QMAKE_PYTHON2) +} + +# Returns the python executable for use with shell / make targets. +defineReplace(pythonPathForShell) { + return($$shell_quote($$shell_path($$pythonPath()))) +} + +# Returns the python executable for use with $$system() +defineReplace(pythonPathForSystem) { + return($$system_quote($$system_path($$pythonPath()))) +} + defineReplace(ninjaPath) { src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT") out = $$shadowed($$absolute_path(ninja/ninja, $$src_3rd_party_dir)) |