summaryrefslogtreecommitdiffstats
path: root/src/buildtools/gn.pro
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2017-04-26 15:39:33 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2017-04-28 16:26:32 +0000
commit9df14dff86fcc2daa0d9342174dba62ec32169bc (patch)
tree4bb20783045b0e8d92f9418c99a30b318ccbd731 /src/buildtools/gn.pro
parent4ee9cf19095a66b1cdb47229b1a1e7957dff584f (diff)
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 <joerg.bornemann@qt.io>
Diffstat (limited to 'src/buildtools/gn.pro')
-rw-r--r--src/buildtools/gn.pro46
1 files changed, 20 insertions, 26 deletions
diff --git a/src/buildtools/gn.pro b/src/buildtools/gn.pro
index f8f8b20da..829e7a31a 100644
--- a/src/buildtools/gn.pro
+++ b/src/buildtools/gn.pro
@@ -1,36 +1,30 @@
TEMPLATE = aux
-CONFIG += release
-
option(host_build)
-defineReplace(buildGn) {
- gn_args = $$1
- out = $$gnPath()
- !qtConfig(system-ninja): ninja_path = "--path $$ninjaPath()"
- # check if it is not already build
- !exists($$out) {
- mkpath($$dirname(out))
- src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT")
- 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))) && $$pythonPathForSystem() $$gn_configure") {
- error("GN build error!")
- }
- }
-}
+!debug_and_release: CONFIG += release
isQtMinimum(5, 8) {
include($$QTWEBENGINE_OUT_ROOT/qtwebengine-config.pri)
QT_FOR_CONFIG += webengine-private
}
-!qtConfig(system-gn) {
- buildgn.target = build_gn
- buildgn.commands = $$buildGn($$gnArgs())
- QMAKE_EXTRA_TARGETS += buildgn
-
- default_target.target = first
- default_target.depends = buildgn
- QMAKE_EXTRA_TARGETS += default_target
+build_pass|!debug_and_release {
+ !qtConfig(system-gn): CONFIG(release, debug|release) {
+ buildgn.target = build_gn
+ gn_args = $$gnArgs()
+ out = $$gnPath()
+ !qtConfig(system-ninja): ninja_path = "--path $$ninjaPath()"
+ # check if it is not already build
+ !exists($$out) {
+ mkpath($$dirname(out))
+ src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT")
+ 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))) && $$pythonPathForSystem() $$gn_configure") {
+ error("GN build error!")
+ }
+ }
+ QMAKE_DISTCLEAN += $$out
+ }
}