summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2016-11-18 19:42:07 +0100
committerMichal Klocek <michal.klocek@qt.io>2016-12-16 17:00:44 +0000
commite00ac03b406f7588a41b83f6d33a8306c3dd92b8 (patch)
treec66ea729f77492fb0fb6c4312817d6abd54f7822 /src/core
parent794606237796b976f9cede7bfdc218e4de6a42ec (diff)
Add gn generator for pro files
Change-Id: I5f28314d79b4aad587b323b027eb6d74ad422a73 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/core.pro24
-rw-r--r--src/core/core_generator.pro (renamed from src/core/core_gyp_generator.pro)13
-rw-r--r--src/core/core_gn_config.pri6
-rw-r--r--src/core/core_gyp_config.pri5
4 files changed, 32 insertions, 16 deletions
diff --git a/src/core/core.pro b/src/core/core.pro
index 86fe838cb..e495685eb 100644
--- a/src/core/core.pro
+++ b/src/core/core.pro
@@ -9,26 +9,32 @@ core_api.file = api/core_api.pro
core_module.file = core_module.pro
core_module.depends = core_api
-contains(WEBENGINE_CONFIG, use_gn) {
+# core_generator.pro is a dummy .pro file that is used by qmake
+# to generate our main .gyp/BUILD.gn file
+core_generator.file = core_generator.pro
+core_generator.depends = core_headers
+
+
+use?(gn) {
+
gn_run.file = gn_run.pro
- SUBDIRS += gn_run
-} else {
+ gn_run.depends = core_generator
- # core_gyp_generator.pro is a dummy .pro file that is used by qmake
- # to generate our main .gyp file
- core_gyp_generator.file = core_gyp_generator.pro
- core_gyp_generator.depends = core_headers
+ SUBDIRS += gn_run \
+ core_headers \
+ core_generator
+} else {
# gyp_run.pro calls gyp through gyp_qtwebengine on the qmake step, and ninja on the make step.
gyp_run.file = gyp_run.pro
- gyp_run.depends = core_gyp_generator
+ gyp_run.depends = core_generator
core_api.depends = gyp_run
SUBDIRS += gyp_run \
core_api \
core_module \
core_headers \
- core_gyp_generator
+ core_generator
!win32 {
# gyp_configure_host.pro and gyp_configure_target.pro are phony pro files that
diff --git a/src/core/core_gyp_generator.pro b/src/core/core_generator.pro
index a09683ba6..223ea076e 100644
--- a/src/core/core_gyp_generator.pro
+++ b/src/core/core_generator.pro
@@ -1,10 +1,9 @@
-# This is a dummy .pro file used to extract some aspects of the used configuration and feed them to gyp
-# We want the gyp generation step to happen after all the other config steps. For that we need to prepend
-# our gyp_generator.prf feature to the CONFIG variable since it is processed backwards
-CONFIG = gyp_generator $$CONFIG
-GYPFILE = $$OUT_PWD/core_generated.gyp
-GYPINCLUDES += $$PWD/qtwebengine.gypi
-GYPSRCDIR = $$PWD
+
+use?(gn) {
+ include(core_gn_config.pri)
+} else {
+ include(core_gyp_config.pri)
+}
TEMPLATE = lib
diff --git a/src/core/core_gn_config.pri b/src/core/core_gn_config.pri
new file mode 100644
index 000000000..ea45977f5
--- /dev/null
+++ b/src/core/core_gn_config.pri
@@ -0,0 +1,6 @@
+CONFIG = gn_generator $$CONFIG
+GN_SRC_DIR = $$PWD
+GN_FILE = $$OUT_PWD/BUILD.gn
+GN_FIND_MOCABLES_SCRIPT = $$shell_path($$QTWEBENGINE_ROOT/tools/scripts/gn_find_mocables.py)
+GN_RUN_BINARY_SCRIPT = $$shell_path($$QTWEBENGINE_ROOT/tools/scripts/gn_run_binary.py)
+
diff --git a/src/core/core_gyp_config.pri b/src/core/core_gyp_config.pri
new file mode 100644
index 000000000..999d019f9
--- /dev/null
+++ b/src/core/core_gyp_config.pri
@@ -0,0 +1,5 @@
+CONFIG = gyp_generator $$CONFIG
+GYPFILE = $$OUT_PWD/core_generated.gyp
+GYPINCLUDES += $$PWD/qtwebengine.gypi
+GYPSRCDIR = $$PWD
+