From 6668f5becfb8fcb6d10e42495c6ea5cdba2d15c5 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sat, 22 Dec 2012 13:12:02 -0800 Subject: Implement a more direct headersclean check Test each include file directly, instead of doing a large #include. This verifies that each header is compilable on its own. One big advantage of doing it via a special compiler in qmake is that we skip pre-compiled headers, which has hidden build errors in the past. This solution is implemented by making syncqt produce a second list of headers. This list is the same as the list of headers in the source code to be installed, minus the headers that declare themselves to be unclean, via the pragma: #pragma qt_sync_skip_header_check This mechanism is applied only for public libraries (skipping QtPlatformSupport, an internal_module). This test is enabled only for -developer-builds of Qt because it increases the compilation time. On QtTest: the library only links to QtCore, but it has two headers that provide inline-only functionality by including QtGui and QtWidgets headers (namely, qtest_gui.h and qtest_widget.h). If those two modules aren't getting compiled due to -no-gui or -no-widgets to configure, we need to remove the respective headers from the list of headers to be checked. If they are being built, then we need to make QtTest's build wait for the headers to be generated and that happens when qmake is first run inside the src/gui and src/widgets directories. Change-Id: I57d64bd697a92367c8464c073a42e4d142a9a15f Reviewed-by: Oswald Buddenhagen --- src/src.pro | 4 +++- src/testlib/testlib.pro | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/src.pro b/src/src.pro index fcdc6c32e0..b4d62aa8b0 100644 --- a/src/src.pro +++ b/src/src.pro @@ -81,7 +81,7 @@ src_network.depends = src_corelib src_testlib.subdir = $$PWD/testlib src_testlib.target = sub-testlib -src_testlib.depends = src_corelib # src_gui & src_widgets are not build-depends +src_testlib.depends = src_corelib # testlib links only to corelib, but see below for the headers src_3rdparty_pcre.subdir = $$PWD/3rdparty/pcre src_3rdparty_pcre.target = sub-3rdparty-pcre @@ -166,10 +166,12 @@ contains(QT_CONFIG, concurrent):SUBDIRS += src_concurrent SUBDIRS += src_gui src_platformsupport src_platformheaders contains(QT_CONFIG, opengl(es2)?):SUBDIRS += src_openglextensions src_plugins.depends += src_gui src_platformsupport src_platformheaders + src_testlib.depends += src_gui # if QtGui is enabled, QtTest requires QtGui's headers !contains(QT_CONFIG, no-widgets) { SUBDIRS += src_tools_uic src_widgets TOOLS += src_tools_uic src_plugins.depends += src_widgets + src_testlib.depends += src_widgets # if QtWidgets is enabled, QtTest requires QtWidgets's headers contains(QT_CONFIG, opengl(es2)?) { SUBDIRS += src_opengl src_plugins.depends += src_opengl diff --git a/src/testlib/testlib.pro b/src/testlib/testlib.pro index 841d913105..83f217dde9 100644 --- a/src/testlib/testlib.pro +++ b/src/testlib/testlib.pro @@ -97,4 +97,9 @@ mac { } } +# Exclude these headers from the clean check if their dependencies aren't +# being built +contains(QT_CONFIG, no-widgets): HEADERSCLEAN_EXCLUDE += qtest_widgets.h +contains(QT_CONFIG, no-gui): HEADERSCLEAN_EXCLUDE += qtest_gui.h + load(qt_module) -- cgit v1.2.3