From e453be82f510303e41a24c0093bd03c7f8374f75 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 25 Apr 2017 12:46:36 +0200 Subject: Make python2 usage more robust After configuring Qt there will be an error message if a suitable python version could not be found. Add python2 configure test that - first looks for python2 in PATH - then looks for python in PATH - checks the Python version - stores the result in QMAKE_PYTHON2 Use $$QMAKE_PYTHON2 everywhere where we call python. Pass $$QMAKE_PYTHON2 to gn for its exec_script feature. Task-number: QTBUG-60164 Change-Id: I33de1273cbd20a787b3c8889d35280784dbcd5ae Reviewed-by: Oswald Buddenhagen Reviewed-by: Michal Klocek --- src/buildtools/gn.pro | 2 +- src/buildtools/ninja.pro | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/buildtools') diff --git a/src/buildtools/gn.pro b/src/buildtools/gn.pro index 092888e0e..f8f8b20da 100644 --- a/src/buildtools/gn.pro +++ b/src/buildtools/gn.pro @@ -14,7 +14,7 @@ defineReplace(buildGn) { gn_bootstrap = $$system_path($$absolute_path(chromium/tools/gn/bootstrap/bootstrap.py, $$src_3rd_party_dir)) gn_args = $$system_quote($$gn_args) gn_configure = $$system_quote($$gn_bootstrap) --shadow --gn-gen-args=$$gn_args $$ninja_path - !system("cd $$system_quote($$system_path($$dirname(out))) && python $$gn_configure") { + !system("cd $$system_quote($$system_path($$dirname(out))) && $$pythonPathForSystem() $$gn_configure") { error("GN build error!") } } diff --git a/src/buildtools/ninja.pro b/src/buildtools/ninja.pro index c391d6e84..0a01f1f4e 100644 --- a/src/buildtools/ninja.pro +++ b/src/buildtools/ninja.pro @@ -8,7 +8,7 @@ defineReplace(buildNinja) { mkpath($$dirname(out)) src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT") ninja_configure = $$system_quote($$system_path($$absolute_path(ninja/configure.py, $$src_3rd_party_dir))) - !system("cd $$system_quote($$system_path($$dirname(out))) && python $$ninja_configure --bootstrap") { + !system("cd $$system_quote($$system_path($$dirname(out))) && $$pythonPathForSystem() $$ninja_configure --bootstrap") { error("NINJA build error!") } } -- cgit v1.2.3