summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2016-10-21 18:03:36 +0200
committerMichal Klocek <michal.klocek@qt.io>2016-12-02 17:39:21 +0000
commit3d000cfc013158f56c0b088c9ee99b03938ef50b (patch)
treef2546577cb89735e9e132072ff5a01c2f6beb2aa
parente97074f9853dae328747c75054612a5bb941236a (diff)
Split ninja target into runninja and buildninja in gyp_run
Small refactor to split the targets in makefile. Bootstrapping gn will need also ninja build. Change-Id: Id177a0189b79cf353b6bd27c4e087f4e960f56c2 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
-rw-r--r--src/core/gyp_run.pro17
-rw-r--r--tools/qmake/mkspecs/features/functions.prf23
2 files changed, 24 insertions, 16 deletions
diff --git a/src/core/gyp_run.pro b/src/core/gyp_run.pro
index 7351b2443..7ab8cbb13 100644
--- a/src/core/gyp_run.pro
+++ b/src/core/gyp_run.pro
@@ -155,15 +155,22 @@ for (config, GYP_CONFIG): GYP_ARGS += "-D $$config"
build_pass|!debug_and_release {
ninja_binary = ninja
- ninja.target = invoke_ninja
+ runninja.target = run_ninja
+
+ !qtConfig(system-ninja) {
+ ninja_binary = $$shell_quote($$shell_path($$ninjaPath()))
+ buildninja.target = build_ninja
+ buildninja.commands = $$buildNinja()
+ QMAKE_EXTRA_TARGETS += buildninja
+ runninja.depends = buildninja
+ }
- !qtConfig(system-ninja): ninja_binary = $$shell_quote($$shell_path($$buildNinja()))
- ninja.commands = $$ninja_binary \$\(NINJAFLAGS\) -C $$shell_quote($$OUT_PWD/$$getConfigDir())
- QMAKE_EXTRA_TARGETS += ninja
+ runninja.commands = $$ninja_binary \$\(NINJAFLAGS\) -C $$shell_quote($$OUT_PWD/$$getConfigDir())
+ QMAKE_EXTRA_TARGETS += runninja
build_pass:build_all: default_target.target = all
else: default_target.target = first
- default_target.depends = ninja
+ default_target.depends = runninja
QMAKE_EXTRA_TARGETS += default_target
} else {
diff --git a/tools/qmake/mkspecs/features/functions.prf b/tools/qmake/mkspecs/features/functions.prf
index d0a922f9c..fbd92b133 100644
--- a/tools/qmake/mkspecs/features/functions.prf
+++ b/tools/qmake/mkspecs/features/functions.prf
@@ -368,23 +368,24 @@ defineTest(use?) {
return(false)
}
-defineReplace(buildNinja) {
-
+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
-
- # check if it is not already built
- !exists($$out) {
- mkpath($$dirname(out))
- ninja_configure = $$absolute_path(ninja/configure.py, $$src_3rd_party_dir)
- system("cd $$system_quote($$system_path($$dirname(out))) && python $$system_quote($$system_path($$ninja_configure)) --bootstrap")
- }
-
return($$out)
}
+defineReplace(buildNinja) {
+ out = $$ninjaPath()
+ # check if it is not already build
+ !exists($$out) {
+ mkpath($$dirname(out))
+ src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT")
+ ninja_configure = $$absolute_path(ninja/configure.py, $$src_3rd_party_dir)
+ system("cd $$system_quote($$system_path($$dirname(out))) && python $$system_quote($$system_path($$ninja_configure)) --bootstrap")
+ }
+}
+
defineTest(skipBuild) {
skipBuildReason = "$$skipBuildReason $${EOL}$$1"
export(skipBuildReason)