summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <[email protected]>2017-01-09 11:23:10 +0100
committerUlf Hermann <[email protected]>2017-03-22 15:55:55 +0000
commit329385a5d53f7c20d25b8b492acdd45a5c5ff194 (patch)
tree6353bee521ffec232ad6944f511da373bca45678
parentc587036dc630bc3cd00ad5ffc1529f25df185a26 (diff)
Build examples and tests only if their requirements are met
If the respective modules aren't available we cannot build the tests and examples. We drop the qtConfig(opengl) requirement for the opengl examples as a, we would need to make the QtGui configuration available for that to work, and b, we should not add too much detail to the tests and examples build configurations. Checking each test and example for every feature it uses would be too much. Task-number: QTBUG-57255 Change-Id: Ifb043c81ec9e5c487765297bd65704812cd281fc Reviewed-by: Oswald Buddenhagen <[email protected]>
-rw-r--r--examples/examples.pro19
-rw-r--r--examples/sql/sql.pro2
-rw-r--r--examples/widgets/itemviews/itemviews.pro1
-rw-r--r--tests/auto/auto.pro2
-rw-r--r--tests/auto/corelib/io/io.pro5
-rw-r--r--tests/auto/corelib/itemmodels/itemmodels.pro10
-rw-r--r--tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase.pro6
-rw-r--r--tests/auto/corelib/thread/thread.pro6
-rw-r--r--tests/auto/corelib/xml/xml.pro2
-rw-r--r--tests/auto/dbus/dbus.pro3
-rw-r--r--tests/auto/gui/text/text.pro4
-rw-r--r--tests/tests.pro2
12 files changed, 44 insertions, 18 deletions
diff --git a/examples/examples.pro b/examples/examples.pro
index f66c5cbf220..a3851c6d810 100644
--- a/examples/examples.pro
+++ b/examples/examples.pro
@@ -3,19 +3,18 @@ CONFIG += no_docs_target
SUBDIRS = \
corelib \
- dbus \
embedded \
- gui \
- network \
qpa \
- qtconcurrent \
- qtestlib \
- sql \
- touch \
- widgets \
- xml
+ touch
-qtHaveModule(gui):qtConfig(opengl): SUBDIRS += opengl
+qtHaveModule(dbus): SUBDIRS += dbus
+qtHaveModule(network): SUBDIRS += network
+qtHaveModule(testlib): SUBDIRS += qtestlib
+qtHaveModule(concurrent): SUBDIRS += qtconcurrent
+qtHaveModule(sql): SUBDIRS += sql
+qtHaveModule(widgets): SUBDIRS += widgets
+qtHaveModule(xml): SUBDIRS += xml
+qtHaveModule(gui): SUBDIRS += gui opengl
aggregate.files = aggregate/examples.pro
aggregate.path = $$[QT_INSTALL_EXAMPLES]
diff --git a/examples/sql/sql.pro b/examples/sql/sql.pro
index e7bf3e76d93..135d05b4e29 100644
--- a/examples/sql/sql.pro
+++ b/examples/sql/sql.pro
@@ -8,7 +8,7 @@ SUBDIRS = books \
relationaltablemodel \
sqlwidgetmapper
-!wince: SUBDIRS += masterdetail
+!wince:qtHaveModule(xml): SUBDIRS += masterdetail
!wince: SUBDIRS += \
querymodel \
diff --git a/examples/widgets/itemviews/itemviews.pro b/examples/widgets/itemviews/itemviews.pro
index a76c8a10770..787217a8e8f 100644
--- a/examples/widgets/itemviews/itemviews.pro
+++ b/examples/widgets/itemviews/itemviews.pro
@@ -20,3 +20,4 @@ SUBDIRS = addressbook \
stardelegate \
storageview
contains(DEFINES, QT_NO_DRAGANDDROP): SUBDIRS -= puzzle
+!qtHaveModule(xml): SUBDIRS -= simpledommodel
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index d3c4d470f5b..f4ab0d84646 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -31,6 +31,8 @@ else:!qtConfig(process): SUBDIRS -= tools
!qtHaveModule(concurrent): SUBDIRS -= concurrent
!qtHaveModule(network): SUBDIRS -= network
!qtHaveModule(dbus): SUBDIRS -= dbus
+!qtHaveModule(xml): SUBDIRS -= xml
+!qtHaveModule(sql): SUBDIRS -= sql
# Disable the QtDBus tests if we can't connect to the session bus
!cross_compile:qtHaveModule(dbus) {
diff --git a/tests/auto/corelib/io/io.pro b/tests/auto/corelib/io/io.pro
index 5e20f5de5cc..ec2c803012c 100644
--- a/tests/auto/corelib/io/io.pro
+++ b/tests/auto/corelib/io/io.pro
@@ -49,6 +49,11 @@ SUBDIRS=\
qprocess \
qtextstream
+!qtHaveModule(concurrent): SUBDIRS -= \
+ qdebug \
+ qlockfile \
+ qurl
+
!qtConfig(private_tests): SUBDIRS -= \
qabstractfileengine \
qfileinfo \
diff --git a/tests/auto/corelib/itemmodels/itemmodels.pro b/tests/auto/corelib/itemmodels/itemmodels.pro
index 7e0e3a0944a..c1d75cc2cb3 100644
--- a/tests/auto/corelib/itemmodels/itemmodels.pro
+++ b/tests/auto/corelib/itemmodels/itemmodels.pro
@@ -8,6 +8,10 @@ qtHaveModule(gui): SUBDIRS += \
qidentityproxymodel \
qitemselectionmodel \
-qtHaveModule(widgets): SUBDIRS += \
- qitemmodel \
- qsortfilterproxymodel \
+qtHaveModule(widgets) {
+ SUBDIRS += \
+ qsortfilterproxymodel
+
+ qtHaveModule(sql): SUBDIRS += \
+ qitemmodel
+}
diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase.pro b/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase.pro
index 536a6b64de8..f8217025648 100644
--- a/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase.pro
+++ b/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase.pro
@@ -1,3 +1,5 @@
TEMPLATE = subdirs
-SUBDIRS = qmimedatabase-xml
-unix:!mac:!qnx: SUBDIRS += qmimedatabase-cache
+qtHaveModule(concurrent) {
+ SUBDIRS = qmimedatabase-xml
+ unix:!darwin:!qnx: SUBDIRS += qmimedatabase-cache
+}
diff --git a/tests/auto/corelib/thread/thread.pro b/tests/auto/corelib/thread/thread.pro
index f18dad6a4cb..d3c669859bd 100644
--- a/tests/auto/corelib/thread/thread.pro
+++ b/tests/auto/corelib/thread/thread.pro
@@ -6,7 +6,6 @@ SUBDIRS=\
qresultstore \
qfuture \
qfuturesynchronizer \
- qfuturewatcher \
qmutex \
qmutexlocker \
qreadlocker \
@@ -18,3 +17,8 @@ SUBDIRS=\
qthreadstorage \
qwaitcondition \
qwritelocker
+
+qtHaveModule(concurrent) {
+ SUBDIRS += \
+ qfuturewatcher
+}
diff --git a/tests/auto/corelib/xml/xml.pro b/tests/auto/corelib/xml/xml.pro
index 20519edf1be..374e695aa70 100644
--- a/tests/auto/corelib/xml/xml.pro
+++ b/tests/auto/corelib/xml/xml.pro
@@ -1,3 +1,3 @@
TEMPLATE=subdirs
-qtHaveModule(network): SUBDIRS= \
+qtHaveModule(network):qtHaveModule(xml): SUBDIRS= \
qxmlstream
diff --git a/tests/auto/dbus/dbus.pro b/tests/auto/dbus/dbus.pro
index 2c58d7e2354..6878c9341df 100644
--- a/tests/auto/dbus/dbus.pro
+++ b/tests/auto/dbus/dbus.pro
@@ -34,3 +34,6 @@ SUBDIRS+=\
qdbusabstractinterface \
qdbusinterface \
qdbusmarshall
+
+!qtHaveModule(xml): SUBDIRS -= \
+ qdbusxmlparser
diff --git a/tests/auto/gui/text/text.pro b/tests/auto/gui/text/text.pro
index d1a3eda4fc0..6b033fb506d 100644
--- a/tests/auto/gui/text/text.pro
+++ b/tests/auto/gui/text/text.pro
@@ -35,3 +35,7 @@ win32:SUBDIRS -= qtextpiecetable
qtextpiecetable \
qzip \
qtextodfwriter
+
+!qtHaveModule(xml): SUBDIRS -= \
+ qcssparser \
+ qtextdocument
diff --git a/tests/tests.pro b/tests/tests.pro
index 346102ab7bc..a3ca94a94f7 100644
--- a/tests/tests.pro
+++ b/tests/tests.pro
@@ -1,5 +1,7 @@
TEMPLATE = subdirs
CONFIG += no_docs_target
+requires(qtHaveModule(testlib))
+
SUBDIRS = auto
# benchmarks in debug mode is rarely sensible