add a .qmake.conf file which load()s qt_build_config
authorOswald Buddenhagen <oswald.buddenhagen@digia.com>
Tue, 18 Sep 2012 20:01:10 +0000 (22:01 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 18 Oct 2012 15:42:40 +0000 (17:42 +0200)
that way we don't have to auto-generate code for that in the configures.

note that we now load qt_build_config.prf instead of just qmodule.pri,
which means that exceptions_off is set everywhere. we forcibly re-enable
them for testcases to minimize the deviation from default 3rd party usage.
testlib selftests are not qt testcases, so the one that needs exceptions
needs to enable them explicitly.

Change-Id: I1b9360bb11f2e80c92a2b63a7c45991ad17fda1b
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
.qmake.conf [new file with mode: 0644]
configure
mkspecs/features/qt_build_config.prf
mkspecs/features/testcase.prf
tests/auto/testlib/selftests/exceptionthrow/exceptionthrow.pro
tools/configure/configureapp.cpp

diff --git a/.qmake.conf b/.qmake.conf
new file mode 100644 (file)
index 0000000..42ba8e4
--- /dev/null
@@ -0,0 +1 @@
+load(qt_build_config)
index 684948e..643b640 100755 (executable)
--- a/configure
+++ b/configure
@@ -6114,7 +6114,6 @@ cat >>"$CACHEFILE.tmp" <<EOF
 QT_SOURCE_TREE = \$\$quote($relpath)
 QT_BUILD_TREE = \$\$quote($outpath)
 
-include(\$\$PWD/mkspecs/qmodule.pri)
 CONFIG += fix_output_dirs no_private_qt_headers_warning QTDIR_build
 
 EOF
index 6b41229..a2ad442 100644 (file)
@@ -15,5 +15,6 @@ mac {
    }
 }
 
-# Qt modules get compiled without exceptions enabled by default
-CONFIG += exceptions_off
+# Qt modules get compiled without exceptions enabled by default.
+# However, testcases should be still built with exceptions.
+CONFIG += exceptions_off testcase_exceptions
index 6406501..faf4eeb 100644 (file)
@@ -1,5 +1,11 @@
 have_target {
 
+# qt_build_config.prf disables execptions for all Qt modules which don't
+# explicitly turn it on again, while the qmake default is to build with
+# exceptions. As we want tests to be built like 3rd party applications,
+# qt_build_config tells us to re-enable exceptions here.
+testcase_exceptions: CONFIG += exceptions
+
 check.files                =
 check.path                 = .
 
index fa4e9a7..76000ce 100644 (file)
@@ -3,6 +3,7 @@ QT = core testlib
 
 mac:CONFIG -= app_bundle
 CONFIG -= debug_and_release_target
+CONFIG += exceptions
 
 TARGET = exceptionthrow
 DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
index b7442eb..81daece 100644 (file)
@@ -2670,8 +2670,6 @@ void Configure::generateCachefile()
     if (cacheFile.open(QFile::WriteOnly | QFile::Text)) { // Truncates any existing file.
         QTextStream cacheStream(&cacheFile);
 
-        cacheStream << "include($$PWD/mkspecs/qmodule.pri)" << endl;
-
         for (QStringList::Iterator var = qmakeVars.begin(); var != qmakeVars.end(); ++var) {
             cacheStream << (*var) << endl;
         }