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/core/gn_run.pro | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/core/gn_run.pro') diff --git a/src/core/gn_run.pro b/src/core/gn_run.pro index 07635d04c..b6966a51d 100644 --- a/src/core/gn_run.pro +++ b/src/core/gn_run.pro @@ -51,7 +51,8 @@ build_pass|!debug_and_release { gn_args = $$shell_quote($$gn_args) gn_src_root = $$shell_quote($$shell_path($$QTWEBENGINE_ROOT/$$getChromiumSrcDir())) gn_build_root = $$shell_quote($$shell_path($$OUT_PWD/$$getConfigDir())) - $$runGn($$gn_binary gen $$gn_build_root --args=$$gn_args --root=$$gn_src_root) + gn_python = "--script-executable=$$pythonPathForSystem()" + $$runGn($$gn_binary gen $$gn_build_root $$gn_python --args=$$gn_args --root=$$gn_src_root) runninja.commands = $$NINJA \$\(NINJAFLAGS\) -C $$gn_build_root QtWebEngineCore QMAKE_EXTRA_TARGETS += runninja -- cgit v1.2.3 From 9df14dff86fcc2daa0d9342174dba62ec32169bc Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Wed, 26 Apr 2017 15:39:33 +0200 Subject: Clean "system" calls to build&run gn and ninja There was a time when gn build was called during make step, however this was not working with recursive qmake calls. Clean up leftovers and fix path and warnings like "Conditional must expand to exactly one word." during builds. Change-Id: I8546520345a5f89ee829558fa0fd9183587848b3 Reviewed-by: Joerg Bornemann --- src/core/gn_run.pro | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'src/core/gn_run.pro') diff --git a/src/core/gn_run.pro b/src/core/gn_run.pro index b6966a51d..ee4e7892e 100644 --- a/src/core/gn_run.pro +++ b/src/core/gn_run.pro @@ -5,13 +5,6 @@ isQtMinimum(5, 8) { TEMPLATE = aux -defineReplace(runGn) { - message("Running: $$1") - !system($$1) { - error("GN run error!") - } -} - qtConfig(debug_and_release): CONFIG += debug_and_release build_all qtConfig(system-ninja) { @@ -42,17 +35,22 @@ build_pass|!debug_and_release { gn_args += is_debug=false } - gn_args += "qtwebengine_target=\"$$shell_path($$OUT_PWD/$$getConfigDir()):QtWebEngineCore\"" + gn_args += "qtwebengine_target=\"$$system_path($$OUT_PWD/$$getConfigDir()):QtWebEngineCore\"" !qtConfig(system-gn) { - gn_binary = $$shell_quote($$shell_path($$gnPath())) + gn_binary = $$system_quote($$system_path($$gnPath())) } - gn_args = $$shell_quote($$gn_args) - gn_src_root = $$shell_quote($$shell_path($$QTWEBENGINE_ROOT/$$getChromiumSrcDir())) - gn_build_root = $$shell_quote($$shell_path($$OUT_PWD/$$getConfigDir())) + gn_args = $$system_quote($$gn_args) + gn_src_root = $$system_quote($$system_path($$QTWEBENGINE_ROOT/$$getChromiumSrcDir())) + gn_build_root = $$system_quote($$system_path($$OUT_PWD/$$getConfigDir())) gn_python = "--script-executable=$$pythonPathForSystem()" - $$runGn($$gn_binary gen $$gn_build_root $$gn_python --args=$$gn_args --root=$$gn_src_root) + gn_run = $$gn_binary gen $$gn_build_root $$gn_python --args=$$gn_args --root=$$gn_src_root + + message("Running: $$gn_run ") + !system($$gn_run) { + error("GN run error!") + } runninja.commands = $$NINJA \$\(NINJAFLAGS\) -C $$gn_build_root QtWebEngineCore QMAKE_EXTRA_TARGETS += runninja -- cgit v1.2.3