Snippets: Fix dependency issues

The widget snippet was sometimes ignored, because the printsupport
dependency was not explicit in the top-level src.pro file. This lead
to a situation that, if printsupport by chance was already built,
it was tested, otherwise silently ignored.

This shows that having requires(qtHaveModule()) inside src/ is actually
harmful, and they are therefore removed from snippets.pro. Also, the
dependencies for the snippets projects are now moved to a central place
so that the correctness is easier to check.

Pick-to: 5.15
Change-Id: Ice051fa04848040e206c78361fbbcf680383c6b2
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
This commit is contained in:
Kai Koehne 2020-05-06 15:09:37 +02:00
parent 5bfbae7d20
commit 56c203fc09
3 changed files with 32 additions and 37 deletions

View File

@ -172,34 +172,13 @@ win32:SUBDIRS += src_winmain
qtConfig(network) {
SUBDIRS += src_network
src_plugins.depends += src_network
qtHaveModule(gui):qtConfig(private_tests) {
src_network_doc_snippets.subdir = network/doc/snippets
src_network_doc_snippets.target = sub-network-doc-snippets
src_network_doc_snippets.depends = src_network
SUBDIRS += src_network_doc_snippets
}
}
qtConfig(sql) {
SUBDIRS += src_sql
src_plugins.depends += src_sql
qtConfig(private_tests) {
src_sql_doc_snippets.subdir = sql/doc/snippets
src_sql_doc_snippets.target = sub-sql-doc-snippets
src_sql_doc_snippets.depends = src_sql
SUBDIRS += src_sql_doc_snippets
}
}
qtConfig(xml): SUBDIRS += src_xml
qtConfig(testlib) {
SUBDIRS += src_testlib
qtConfig(private_tests) {
src_testlib_doc_snippets.subdir = testlib/doc/snippets
src_testlib_doc_snippets.target = sub-testlib-doc-snippets
src_testlib_doc_snippets.depends = src_testlib
SUBDIRS += src_testlib_doc_snippets
}
}
qtConfig(testlib): SUBDIRS += src_testlib
qtConfig(dbus) {
force_dbus_bootstrap|qtConfig(private_tests): \
@ -260,15 +239,7 @@ qtConfig(gui) {
SUBDIRS += src_printsupport
src_plugins.depends += src_printsupport
}
qtConfig(opengl) {
SUBDIRS += src_openglwidgets
}
qtConfig(private_tests) {
src_widgets_doc_snippets.subdir = widgets/doc/snippets
src_widgets_doc_snippets.target = sub-widgets-doc-snippets
src_widgets_doc_snippets.depends = src_widgets
SUBDIRS += src_widgets_doc_snippets
}
qtConfig(opengl): SUBDIRS += src_openglwidgets
}
}
SUBDIRS += src_plugins
@ -277,6 +248,36 @@ nacl: SUBDIRS -= src_network src_testlib
android:!android-embedded: SUBDIRS += src_android src_3rdparty_gradle
qtConfig(private_tests) {
qtConfig(network):qtConfig(gui) {
src_network_doc_snippets.subdir = network/doc/snippets
src_network_doc_snippets.target = sub-network-doc-snippets
src_network_doc_snippets.depends = src_network src_gui
SUBDIRS += src_network_doc_snippets
}
qtConfig(sql) {
src_sql_doc_snippets.subdir = sql/doc/snippets
src_sql_doc_snippets.target = sub-sql-doc-snippets
src_sql_doc_snippets.depends = src_sql
SUBDIRS += src_sql_doc_snippets
}
qtConfig(testlib):qtConfig(widgets):qtConfig(sql) {
src_testlib_doc_snippets.subdir = testlib/doc/snippets
src_testlib_doc_snippets.target = sub-testlib-doc-snippets
src_testlib_doc_snippets.depends = src_testlib src_widgets src_sql
SUBDIRS += src_testlib_doc_snippets
}
qtConfig(widgets):qtConfig(printer):qtConfig(opengl) {
src_widgets_doc_snippets.subdir = widgets/doc/snippets
src_widgets_doc_snippets.target = sub-widgets-doc-snippets
src_widgets_doc_snippets.depends = src_widgets src_printsupport src_opengl
SUBDIRS += src_widgets_doc_snippets
}
}
TR_EXCLUDE = \
src_tools_bootstrap src_tools_moc src_tools_rcc src_tools_uic src_tools_qlalr \
src_tools_bootstrap_dbus src_tools_qdbusxml2cpp src_tools_qdbuscpp2xml \

View File

@ -1,6 +1,3 @@
requires(qtHaveModule(sql))
requires(qtHaveModule(widgets))
TEMPLATE = app
TARGET = testlib_cppsnippet
QT = core testlib sql widgets

View File

@ -1,6 +1,3 @@
requires(qtHaveModule(widgets))
requires(qtHaveModule(printsupport))
TEMPLATE = lib
TARGET = widgets_snippets