Skip to content

Commit

Permalink
make bootstrapped build work entirely without generated headers
Browse files Browse the repository at this point in the history
instead, the only relevant defines from qconfig.h (QT_VERSION*) are
passed on the command line, like we already did for qmake and
configure.exe.
this enables us to remove the early forwarding header generation from
qtbase.pro, and rely wholly on the regular mechanism from syncqt +
qt_module_headers.prf.
another advantage is that we can be sure that the bootstrapped namespace
is not polluted by the target feature configuration.

Change-Id: If29285cfc697ae56b591e2ff1a2114686d18fb30
Reviewed-by: Lars Knoll <[email protected]>
  • Loading branch information
ossilator authored and laknoll committed Aug 19, 2016
1 parent ce942a2 commit de1da50
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
12 changes: 1 addition & 11 deletions qtbase.pro
Original file line number Diff line number Diff line change
Expand Up @@ -148,21 +148,11 @@ FEATURES_PRI = \
"QT_DISABLED_FEATURES = \$\$unique(QT_DISABLED_FEATURES)"
write_file($$OUT_PWD/mkspecs/qfeatures.pri, FEATURES_PRI)|error()

# Create forwarding headers for qconfig.h
FWD_QCONFIG_H = \
'$${LITERAL_HASH}include "../../src/corelib/global/qconfig.h"'
write_file($$OUT_PWD/include/QtCore/qconfig.h, FWD_QCONFIG_H)|error()
FWD_QTCONFIG = \
'$${LITERAL_HASH}include "qconfig.h"'
write_file($$OUT_PWD/include/QtCore/QtConfig, FWD_QTCONFIG)|error()

# Files created by us
QMAKE_DISTCLEAN += \
src/corelib/global/qfeatures.h \
include/QtCore/qfeatures.h \
mkspecs/qfeatures.pri \
include/QtCore/qconfig.h \
include/QtCore/QtConfig
mkspecs/qfeatures.pri

#mkspecs
mkspecs.path = $$[QT_HOST_DATA]/mkspecs
Expand Down
4 changes: 3 additions & 1 deletion src/3rdparty/zlib/gzguts.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
# endif
#endif

#include "qconfig.h"
#ifndef QT_BOOTSTRAPPED
# include <qconfig.h>
#endif
#if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) && !defined(NO_VIZ) && defined(QT_VISIBILITY_AVAILABLE)
# define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
#else
Expand Down
4 changes: 3 additions & 1 deletion src/3rdparty/zlib/zutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
#ifndef ZUTIL_H
#define ZUTIL_H

#include "qconfig.h"
#ifndef QT_BOOTSTRAPPED
# include <qconfig.h>
#endif
#if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) && !defined(NO_VIZ) && defined(QT_VISIBILITY_AVAILABLE)
# define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
#else
Expand Down
2 changes: 1 addition & 1 deletion src/corelib/global/qglobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
*/
#define QT_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch))

#if !defined(QT_BUILD_QMAKE) && !defined(QT_BUILD_CONFIGURE)
#ifndef QT_BOOTSTRAPPED
#include <QtCore/qconfig.h>
#include <QtCore/qfeatures.h>
#endif
Expand Down
4 changes: 4 additions & 0 deletions src/tools/bootstrap/bootstrap.pro
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ CONFIG += minimal_syncqt internal_module force_bootstrap

MODULE_INCNAME = QtCore QtXml
MODULE_DEFINES = \
QT_VERSION_STR=$$shell_quote(\"$$QT_VERSION\") \
QT_VERSION_MAJOR=$$QT_MAJOR_VERSION \
QT_VERSION_MINOR=$$QT_MINOR_VERSION \
QT_VERSION_PATCH=$$QT_PATCH_VERSION \
QT_BOOTSTRAPPED \
QT_LITE_UNICODE \
QT_NO_CAST_TO_ASCII \
Expand Down

0 comments on commit de1da50

Please sign in to comment.