Doc: Compile snippets only when running tests

Turn snippets projects into subdirs with libraries to avoid
messy dependencies.

Fixes: QTBUG-86497
Pick-to: 5.15
Change-Id: Idb2c43f97d56c9b8d9992617ef716bde40fff5b7
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
This commit is contained in:
Paul Wicking 2020-09-08 06:45:01 +02:00
parent e7c15a60ea
commit 00d9a0ea8e
6 changed files with 42 additions and 32 deletions

View File

@ -0,0 +1,11 @@
TEMPLATE = lib
TARGET = code_snippets
QT = core sql
SOURCES = \
doc_src_sql-driver.cpp \
src_sql_kernel_qsqldatabase.cpp \
src_sql_kernel_qsqlerror.cpp \
src_sql_kernel_qsqlresult.cpp \
src_sql_kernel_qsqldriver.cpp \
src_sql_models_qsqlquerymodel.cpp

View File

@ -1,17 +1,10 @@
TEMPLATE = app
TARGET = sqldatabase_cppsnippet
QT = core sql-private
TEMPLATE = subdirs
TARGET = sqldatabase_snippets
SUBDIRS =
#! [qmake_use]
QT += sql
#! [qmake_use]
contains(QT_BUILD_PARTS, tests) {
SUBDIRS += \
code \
sqldatabase
}
SOURCES += sqldatabase/sqldatabase.cpp \
code/doc_src_sql-driver.cpp \
code/src_sql_kernel_qsqldatabase.cpp \
code/src_sql_kernel_qsqlerror.cpp \
code/src_sql_kernel_qsqlresult.cpp \
code/src_sql_kernel_qsqldriver.cpp \
code/src_sql_models_qsqlquerymodel.cpp
load(qt_common)

View File

@ -0,0 +1,6 @@
TEMPLATE = lib
TARGET = sqldatabase_snippets
QT = core sql
SOURCES = \
sqldatabase.cpp

View File

@ -239,7 +239,6 @@ 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 src_gui
uikit: src_network_doc_snippets.depends += src_plugins
SUBDIRS += src_network_doc_snippets
}
@ -247,7 +246,6 @@ 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
uikit: src_network_doc_snippets.depends += src_plugins
SUBDIRS += src_sql_doc_snippets
}
@ -255,7 +253,6 @@ 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 src_widgets src_sql
uikit: src_network_doc_snippets.depends += src_plugins
SUBDIRS += src_testlib_doc_snippets
}
@ -263,7 +260,6 @@ 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 src_printsupport src_opengl
uikit: src_network_doc_snippets.depends += src_plugins
SUBDIRS += src_widgets_doc_snippets
}
}

View File

@ -0,0 +1,11 @@
TEMPLATE = lib
TARGET = code_snippets
QT += core sql testlib widgets
SOURCES = \
doc_src_qtestevent.cpp \
doc_src_qtestlib.cpp \
doc_src_qtqskip.cpp \
doc_src_qttest.cpp \
src_corelib_kernel_qtestsupport_core.cpp

View File

@ -1,15 +1,8 @@
TEMPLATE = app
TARGET = testlib_cppsnippet
QT = core sql widgets
TEMPLATE = subdirs
SUBDIRS =
#! [qmake_use]
QT += testlib
#! [qmake_use]
contains(QT_BUILD_PARTS, tests) {
SUBDIRS += \
code
}
SOURCES += code/doc_src_qtestlib.cpp \
code/doc_src_qtestevent.cpp \
code/doc_src_qtqskip.cpp \
code/doc_src_qttest.cpp \
code/src_corelib_kernel_qtestsupport_core.cpp
load(qt_common)