summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-12-19 16:36:36 -0800
committerMichael Forney <mforney@mforney.org>2020-01-22 23:54:34 -0800
commit8412b9b3442345b17fe6618a56ed9ed08dfb7417 (patch)
tree3d330fe9cc77f43c9216ad9dc32613e013d66f8d
parent46df03dc0f76628f569d63c08cc42f2e20062672 (diff)
Allow specifying ninja command to use with $NINJA
This was previously supported with $NINJA_PATH until 15a38cb0, when the system-ninja test was added. However, since $NINJA seems to be the more common environment variable for this purpose, use that instead. This allows the builder to use a specific ninja version, or an alternative implementation like samurai[0]. [0] https://github.com/michaelforney/samurai Change-Id: Ib3206ce5032be1ccf2a98b45783e12afebb4949e Reviewed-by: Michal Klocek <michal.klocek@qt.io>
-rw-r--r--configure.pri10
-rw-r--r--mkspecs/features/functions.prf11
-rw-r--r--src/buildtools/configure.json8
-rw-r--r--src/buildtools/gn.pro4
-rw-r--r--src/core/gn_run.pro6
5 files changed, 23 insertions, 16 deletions
diff --git a/configure.pri b/configure.pri
index 3a144e3f8..f1c25fbe1 100644
--- a/configure.pri
+++ b/configure.pri
@@ -159,11 +159,17 @@ defineTest(qtConfTest_detectFlex) {
}
defineTest(qtConfTest_detectNinja) {
- ninja = $$qtConfFindInPath("ninja$$EXE_SUFFIX")
+ ninja = $$qtConfFindInPath($$(NINJA) "ninja$$EXE_SUFFIX")
!isEmpty(ninja) {
qtLog("Found ninja from path: $$ninja")
qtRunLoggedCommand("$$ninja --version", version)|return(false)
- contains(version, "1.[7-9].*"): return(true)
+ contains(version, "1.[7-9].*") {
+ $${1}.path = $$ninja
+ export($${1}.path)
+ $${1}.cache += path
+ export($${1}.cache)
+ return(true)
+ }
qtLog("Ninja version too old")
}
qtLog("Building own ninja")
diff --git a/mkspecs/features/functions.prf b/mkspecs/features/functions.prf
index 512e2523b..8a624b4dc 100644
--- a/mkspecs/features/functions.prf
+++ b/mkspecs/features/functions.prf
@@ -57,10 +57,13 @@ defineReplace(pythonPathForSystem) {
}
defineReplace(ninjaPath) {
- src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT")
- out = $$shadowed($$absolute_path(ninja/ninja, $$src_3rd_party_dir))
- win32: out = $${out}.exe
- return($$out)
+ isEmpty(QMAKE_NINJA) {
+ src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT")
+ out = $$shadowed($$absolute_path(ninja/ninja, $$src_3rd_party_dir))
+ win32: out = $${out}.exe
+ QMAKE_NINJA = $$out
+ }
+ return($$QMAKE_NINJA)
}
defineReplace(gnPath) {
diff --git a/src/buildtools/configure.json b/src/buildtools/configure.json
index a36d05320..72405bd48 100644
--- a/src/buildtools/configure.json
+++ b/src/buildtools/configure.json
@@ -316,7 +316,8 @@
},
"webengine-ninja": {
"label": "system ninja",
- "type": "detectNinja"
+ "type": "detectNinja",
+ "log": "path"
},
"webengine-python2": {
"label": "python2",
@@ -430,7 +431,10 @@
"webengine-system-ninja": {
"label": "Use System Ninja",
"condition": "tests.webengine-ninja",
- "output": [ "privateFeature" ]
+ "output": [
+ "privateFeature",
+ { "type": "varAssign", "name": "QMAKE_NINJA", "value": "tests.webengine-ninja.path" }
+ ]
},
"webengine-system-fontconfig": {
"label": "fontconfig",
diff --git a/src/buildtools/gn.pro b/src/buildtools/gn.pro
index 033202e6e..9e8cfe157 100644
--- a/src/buildtools/gn.pro
+++ b/src/buildtools/gn.pro
@@ -11,8 +11,6 @@ build_pass|!debug_and_release {
buildgn.target = build_gn
out = $$gnPath()
out_path = $$dirname(out)
- !qtConfig(webengine-system-ninja): ninja_path = $$ninjaPath()
- else: ninja_path="ninja"
# check if it is not already build
!exists($$out) {
src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT")
@@ -32,7 +30,7 @@ build_pass|!debug_and_release {
!system("$$pythonPathForSystem() $$gn_configure") {
error("GN generation error!")
}
- !system("cd $$system_quote($$system_path($$out_path)) && $$ninja_path $$basename(out)" ) {
+ !system("cd $$system_quote($$system_path($$out_path)) && $$system_quote($$system_path($$ninjaPath())) $$basename(out)" ) {
error("GN build error!")
}
}
diff --git a/src/core/gn_run.pro b/src/core/gn_run.pro
index 377d8363c..67fe7b965 100644
--- a/src/core/gn_run.pro
+++ b/src/core/gn_run.pro
@@ -6,11 +6,7 @@ TEMPLATE = aux
qtConfig(debug_and_release): CONFIG += debug_and_release build_all
-qtConfig(webengine-system-ninja) {
- QT_TOOL.ninja.binary = ninja
-} else {
- QT_TOOL.ninja.binary = $$shell_quote($$shell_path($$ninjaPath()))
-}
+QT_TOOL.ninja.binary = $$shell_quote($$shell_path($$ninjaPath()))
win32 {
# Add the gnuwin32/bin subdir of qt5.git to PATH. Needed for calling bison and friends.