summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qconfig.cpp.in
diff options
context:
space:
mode:
authorAlexey Edelev <alexey.edelev@qt.io>2021-01-28 16:06:26 +0100
committerAlexey Edelev <alexey.edelev@qt.io>2021-02-25 16:08:43 +0100
commit43c28aa9046967abeb4ad042c8be1aa23a19c282 (patch)
treeb8f4a53cd9aaaa819c853ee51e66ea100c1ae3d5 /src/corelib/global/qconfig.cpp.in
parent5a3bbb55851b84aa6a46c23e5a6fb33b4860edc6 (diff)
Use Core library for qmake instead of the Bootstrap library
Move the qmake-specific logic of the QLibraryInfo class to qmake internals. 'qconfig.cpp.in' now stores information about the library info entries to keep them consistent between qmake and the Core library. qmake requires specific features enabled in the Core library, so building qmake will be skipped if the features are not enabled. All flags directly related to the qmake have been removed from Core lib. Remove all bootstrap related sections from qmake CMakeLists.txt Task-number: QTBUG-89369 Change-Id: I26de157d3bfd4a5526699296e9d46e1c180b89ae Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Diffstat (limited to 'src/corelib/global/qconfig.cpp.in')
-rw-r--r--src/corelib/global/qconfig.cpp.in71
1 files changed, 71 insertions, 0 deletions
diff --git a/src/corelib/global/qconfig.cpp.in b/src/corelib/global/qconfig.cpp.in
index 664924abec..d61b94c806 100644
--- a/src/corelib/global/qconfig.cpp.in
+++ b/src/corelib/global/qconfig.cpp.in
@@ -1,3 +1,19 @@
+/* This file is used to generate the Qt configuration info for the Core library
+ * and the qmake executable. The 'qt_generate_qconfig_cpp' cmake routine
+ * contains variables that replace '@' entires in this file. It's important to
+ * align these values with the following:
+ *
+ * - QLibraryInfo::LibraryPath enum in qtbase/src/corelib/global/qlibraryinfo.h
+ * - qtConfEntries in this file
+ * - QMakeLibraryInfo::LibraryPathQMakeExtras enum in
+ * qtbase/qmake/library/qmakelibraryinfo.h
+ *
+ * The reason for this is pointer mathematics in the QMakeLibraryInfo and
+ * QLibraryInfo implementation when iterating qt_configure_strs. Also
+ * qtConfEntries are strongly bound to QLibraryInfo::LibraryPath and
+ * QMakeLibraryInfo::LibraryPathQMakeExtras enums.
+ */
+
/* Installation date */
static const char qt_configure_installation [12+11] = "qt_instdate=2012-12-20";
/* Installation Info */
@@ -31,3 +47,58 @@ static const char qt_configure_strs[] =
# define QT_CONFIGURE_EXT_PREFIX_PATH qt_configure_ext_prefix_path_str + 12
# define QT_CONFIGURE_HOST_PREFIX_PATH qt_configure_host_prefix_path_str + 12
#endif
+
+
+/* Entries below are shared between qmake and the Core library. Please pay
+ * attention and read the adding rules here and inside QLibraryInfo header.
+ *
+ * To add a new entry in QLibraryInfo::LibraryPath, add it to the enum
+ * in qtbase/src/corelib/global/qlibraryinfo.h and:
+ * - add its relative path in the qtConfEntries[] array below
+ * (the key is what appears in a qt.conf file)
+ * - add a property name in qmake/property.cpp propList[] array
+ * (it's used with qmake -query)
+ * - add to qt_config.prf, qt_module.prf, qt_module_fwdpri.prf
+ */
+
+#ifdef QT_BUILD_QMAKE
+constexpr size_t qtConfEntriesKeySize = 23;
+#else
+constexpr size_t qtConfEntriesKeySize = 19;
+#endif
+
+static const struct {
+ char key[qtConfEntriesKeySize], value[13];
+} qtConfEntries[] = {
+ { "Prefix", "." },
+ { "Documentation", "doc" }, // should be ${Data}/doc
+ { "Headers", "include" },
+ { "Libraries", "lib" },
+#ifdef Q_OS_WIN
+ { "LibraryExecutables", "bin" },
+#else
+ { "LibraryExecutables", "libexec" }, // should be ${ArchData}/libexec
+#endif
+ { "Binaries", "bin" },
+ { "Plugins", "plugins" }, // should be ${ArchData}/plugins
+ { "Qml2Imports", "qml" }, // should be ${ArchData}/qml
+ { "ArchData", "." },
+ { "Data", "." },
+ { "Translations", "translations" }, // should be ${Data}/translations
+ { "Examples", "examples" },
+ { "Tests", "tests" },
+// Put new entries above this line ONLY!
+#ifdef QT_BUILD_QMAKE
+ { "Sysroot", "" },
+ { "SysrootifyPrefix", "" },
+ { "HostBinaries", "bin" },
+ { "HostLibraryExecutables", "libexec" },
+ { "HostLibraries", "lib" },
+ { "HostData", "." },
+ { "TargetSpec", "" },
+ { "HostSpec", "" },
+ { "HostPrefix", "" },
+#endif
+};
+
+static const char platformsSection[] = "Platforms";