diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2016-06-21 18:14:10 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2016-06-22 08:48:41 +0000 |
commit | 56bea56b2d8fabc4b09d41531177a22d9297ce2c (patch) | |
tree | 8d8acdf645304e79717a492e4e03fb8b002c72e9 | |
parent | 7b61d27d51371cca3a4eabf5bb24b0a7509750cc (diff) |
Fix python version check
Chromium requires python version 2.7.6.
Adjust the python version check accordingly.
Change-Id: I988371a1c132e63f3c57b3aeacdc1a50a8cf2dce
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
-rw-r--r-- | tools/qmake/mkspecs/features/functions.prf | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tools/qmake/mkspecs/features/functions.prf b/tools/qmake/mkspecs/features/functions.prf index 9e8886e86..33bebb47a 100644 --- a/tools/qmake/mkspecs/features/functions.prf +++ b/tools/qmake/mkspecs/features/functions.prf @@ -55,16 +55,20 @@ defineTest(isPlatformSupported) { } 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.6 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, 5): return(true) + skipBuild("Using Python version $${python_major_version}.$${python_minor_version}.$${python_patch_version}.") skipBuild($$python_error_msg) return(false) } |