summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMichael Bruning <michael.bruning@theqtcompany.com>2015-11-16 16:18:00 +0100
committerMichael BrĂ¼ning <michael.bruning@theqtcompany.com>2015-11-19 16:32:59 +0000
commit5a8bae70bb6caf01c262ed3a607c736ea72561b9 (patch)
tree61fb3fc21aa7a22183e18cacc3576278898be071 /tools
parentdacb7fa08dd64eaeb8510ca0be24f6da5c2c1b25 (diff)
Build ninja in the shadow build directory.
Essentially makes a copy of the ninja sources to the build directory to be non-intrusive for src/3rdparty. Task-number: QTBUG-44002 Change-Id: I82a686abbfab2579462dcb57e10b16f71a3a0d4e Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/qmake/mkspecs/features/functions.prf31
1 files changed, 22 insertions, 9 deletions
diff --git a/tools/qmake/mkspecs/features/functions.prf b/tools/qmake/mkspecs/features/functions.prf
index 64064bddb..cab79ff28 100644
--- a/tools/qmake/mkspecs/features/functions.prf
+++ b/tools/qmake/mkspecs/features/functions.prf
@@ -150,17 +150,30 @@ defineReplace(which) {
}
defineReplace(findOrBuildNinja) {
- # If NINJA_PATH env var is set, prefer that.
- # Fallback to locating our own bootstrapped ninja.
- out = $(NINJA_PATH)
- !exists($$out) {
- out = $$absolute_path("$${getChromiumSrcDir()}/../ninja/ninja", "$$QTWEBENGINE_ROOT")
- win32: out = $$system_path($${out}.exe)
+ # If NINJA_PATH env var is set, prefer that.
+ # Fallback to locating our own bootstrapped ninja.
+ out = $(NINJA_PATH)
+ !exists($$out) {
+ src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT")
+
+ out = $$shadowed($$absolute_path("ninja/ninja", "$$src_3rd_party_dir"))
+ win32: out = $${out}.exe
- # If we did not find ninja, then we bootstrap it.
- !exists($$out): system("cd $$dirname(out) && python configure.py --bootstrap")
+ out = $$system_path($$out)
+ # If we did not find ninja, then we bootstrap it.
+ !exists($$out) {
+ # If we are making a shadow build, copy the ninja sources to the build directory.
+ !equals(PWD, $${OUT_PWD}) {
+ log("Build directory is different from source directory - copying ninja sources to the build tree...")
+ shadow_3rd_party_path = $$system_path($$shadowed($$src_3rd_party_dir))
+
+ !exists($$dirname(out)): mkpath($$shadow_3rd_party_path)
+ system("$$QMAKE_COPY_DIR $$system_quote($$system_path($$absolute_path("ninja", "$$src_3rd_party_dir"))) $$system_quote($$shadow_3rd_party_path)")
+ }
+ system("cd $$system_quote($$dirname(out)) && python configure.py --bootstrap")
}
- return($$out)
+ }
+ return($$out)
}
defineTest(skipBuild) {