summaryrefslogtreecommitdiffstats
path: root/qtbase.pro
diff options
context:
space:
mode:
Diffstat (limited to 'qtbase.pro')
-rw-r--r--qtbase.pro47
1 files changed, 47 insertions, 0 deletions
diff --git a/qtbase.pro b/qtbase.pro
index d3b03d1fba..afdeed853c 100644
--- a/qtbase.pro
+++ b/qtbase.pro
@@ -103,6 +103,53 @@ prefix_build|!equals(PWD, $$OUT_PWD) {
}
+# Generate qfeatures.h
+features =
+lines = $$cat("src/corelib/global/qfeatures.txt", lines)
+for (line, lines) {
+ t = $$replace(line, "^Feature: (\\S+)\\s*$", "\\1")
+ !isEqual(t, $$line) {
+ feature = $$t
+ features += $$t
+ } else {
+ t = $$replace(line, "^Requires: (.*)$", "\\1")
+ !isEqual(t, $$line) {
+ features.$${feature}.depends = $$replace(t, \\s+$, )
+ } else {
+ t = $$replace(line, "^Name: (.*)$", "\\1")
+ !isEqual(t, $$line) {
+ features.$${feature}.name = $$replace(t, \\s+$, )
+ }
+ }
+ }
+}
+features = $$sort_depends(features, features.)
+features = $$reverse(features)
+FEATURES_H = \
+ "/*" \
+ " * All features and their dependencies." \
+ " *" \
+ " * This list is generated by qmake from <qtbase>/src/corelib/global/qfeatures.txt" \
+ " */"
+for (ft, features) {
+ FEATURES_H += \
+ "$$escape_expand(\\n)// $$eval(features.$${ft}.name)"
+ isEmpty(features.$${ft}.depends) {
+ FEATURES_H += \
+ "//$${LITERAL_HASH}define QT_NO_$$ft"
+ } else {
+ FEATURES_H += \
+ "$${LITERAL_HASH}if !defined(QT_NO_$$ft) && ($$join($$list($$split(features.$${ft}.depends)), ") || defined(QT_NO_", "defined(QT_NO_", ")"))" \
+ "$${LITERAL_HASH} define QT_NO_$$ft" \
+ "$${LITERAL_HASH}endif"
+ }
+}
+write_file($$OUT_PWD/src/corelib/global/qfeatures.h, FEATURES_H)|error("Aborting.")
+# Create forwarding header
+FWD_FEATURES_H = \
+ '$${LITERAL_HASH}include "../../src/corelib/global/qfeatures.h"'
+write_file($$OUT_PWD/include/QtCore/qfeatures.h, FWD_FEATURES_H)|error("Aborting.")
+
#mkspecs
mkspecs.path = $$[QT_HOST_DATA]/mkspecs
mkspecs.files = \