summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-03-17 12:07:44 +0100
committerMarc Mutz <marc.mutz@qt.io>2022-03-29 06:18:49 +0100
commit32692667a625f31aa02e0303f2139c780ae42694 (patch)
treebab74a97f673fd2caee7d1d0b68fac4583fcfb11 /qmake
parent9578a3f72fd67011263eac9d306750a2dbef01d1 (diff)
Apply Q_CONSTINIT across the codebase
Still not complete. Just grepping for static and thread_local. Task-number: QTBUG-100486 Change-Id: I90ca14e8db3a95590ecde5f89924cf6fcc9755a3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'qmake')
-rw-r--r--qmake/generators/makefile.cpp2
-rw-r--r--qmake/generators/metamakefile.cpp2
-rw-r--r--qmake/generators/win32/msvc_objectmodel.cpp6
-rw-r--r--qmake/option.cpp2
4 files changed, 5 insertions, 7 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 82f9c00aec..c9c45990f4 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -2826,7 +2826,7 @@ MakefileGenerator::writeMakeQmake(QTextStream &t, bool noDummyQmakeAll)
QFileInfo
MakefileGenerator::fileInfo(QString file) const
{
- static QHash<FileInfoCacheKey, QFileInfo> *cache = nullptr;
+ Q_CONSTINIT static QHash<FileInfoCacheKey, QFileInfo> *cache = nullptr;
static QFileInfo noInfo = QFileInfo();
if(!cache) {
cache = new QHash<FileInfoCacheKey, QFileInfo>;
diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp
index 8ba941c213..964b4e900e 100644
--- a/qmake/generators/metamakefile.cpp
+++ b/qmake/generators/metamakefile.cpp
@@ -326,7 +326,7 @@ SubdirsMetaMakefileGenerator::init()
if(!thispwd.endsWith('/'))
thispwd += '/';
const ProStringList &subdirs = project->values("SUBDIRS");
- static int recurseDepth = -1;
+ Q_CONSTINIT static int recurseDepth = -1;
++recurseDepth;
for(int i = 0; i < subdirs.size(); ++i) {
Subdir *sub = new Subdir;
diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp
index a18eb076bd..16210e8b2e 100644
--- a/qmake/generators/win32/msvc_objectmodel.cpp
+++ b/qmake/generators/win32/msvc_objectmodel.cpp
@@ -336,14 +336,12 @@ static QString vcCommandSeparator()
// of the custom commands into it, and putting an "if errorlevel goto" statement behind it.
// As we want every sub-command to be error-checked (as is done by makefile-based
// backends), we insert the checks ourselves, using the undocumented jump target.
- static QString cmdSep =
- QLatin1String("&#x000D;&#x000A;if errorlevel 1 goto VCReportError&#x000D;&#x000A;");
- return cmdSep;
+ return QStringLiteral("&#x000D;&#x000A;if errorlevel 1 goto VCReportError&#x000D;&#x000A;");
}
static void unknownOptionWarning(const char *tool, const char *option)
{
- static bool firstCall = true;
+ Q_CONSTINIT static bool firstCall = true;
warn_msg(WarnLogic, "Could not parse %s option '%s'; added to AdditionalOptions.", tool, option);
if (firstCall) {
firstCall = false;
diff --git a/qmake/option.cpp b/qmake/option.cpp
index e9807a15b5..f30121e416 100644
--- a/qmake/option.cpp
+++ b/qmake/option.cpp
@@ -631,7 +631,7 @@ public:
*data = nullptr;
}
};
-static QList<QMakeCacheClearItem*> cache_items;
+Q_CONSTINIT static QList<QMakeCacheClearItem*> cache_items;
void
qmakeClearCaches()