summaryrefslogtreecommitdiffstats
path: root/qmake/generators/win32/msvc_nmake.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qmake/generators/win32/msvc_nmake.cpp')
-rw-r--r--qmake/generators/win32/msvc_nmake.cpp56
1 files changed, 17 insertions, 39 deletions
diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp
index 50666215c6..b5df617927 100644
--- a/qmake/generators/win32/msvc_nmake.cpp
+++ b/qmake/generators/win32/msvc_nmake.cpp
@@ -1,37 +1,12 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the qmake application of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "msvc_nmake.h"
#include "option.h"
#include <qregularexpression.h>
#include <qdir.h>
-#include <qdiriterator.h>
+#include <qdirlisting.h>
#include <qset.h>
#include <time.h>
@@ -174,6 +149,10 @@ QString NmakeMakefileGenerator::var(const ProKey &value) const
return MakefileGenerator::var(value);
}
+void NmakeMakefileGenerator::suppressBuiltinRules(QTextStream &) const
+{
+}
+
void NmakeMakefileGenerator::init()
{
/* this should probably not be here, but I'm using it to wrap the .t files */
@@ -285,9 +264,9 @@ QStringList NmakeMakefileGenerator::sourceFilesForImplicitRulesFilter()
{
QStringList filter;
const QChar wildcard = QLatin1Char('*');
- for (const QString &ext : qAsConst(Option::c_ext))
+ for (const QString &ext : std::as_const(Option::c_ext))
filter << wildcard + ext;
- for (const QString &ext : qAsConst(Option::cpp_ext))
+ for (const QString &ext : std::as_const(Option::cpp_ext))
filter << wildcard + ext;
return filter;
}
@@ -311,7 +290,7 @@ void NmakeMakefileGenerator::writeImplicitRulesPart(QTextStream &t)
for (int y = 0; directories[y]; y++) {
QString dirTemp = project->first(directories[y]).toQString();
if (dirTemp.endsWith("\\"))
- dirTemp.truncate(dirTemp.length()-1);
+ dirTemp.truncate(dirTemp.size()-1);
if(!dirTemp.isEmpty())
source_directories.insert(dirTemp);
}
@@ -335,16 +314,15 @@ void NmakeMakefileGenerator::writeImplicitRulesPart(QTextStream &t)
const QStringList sourceFilesFilter = sourceFilesForImplicitRulesFilter();
QStringList fixifiedSourceDirs = fileFixify(QList<QString>(source_directories.constBegin(), source_directories.constEnd()), FileFixifyAbsolute);
fixifiedSourceDirs.removeDuplicates();
- for (const QString &sourceDir : qAsConst(fixifiedSourceDirs)) {
- QDirIterator dit(sourceDir, sourceFilesFilter, QDir::Files | QDir::NoDotAndDotDot);
- while (dit.hasNext()) {
- const QFileInfo fi = dit.nextFileInfo();
- QString &duplicate = fileNames[fi.completeBaseName()];
+ constexpr auto filters = QDir::Files | QDir::NoDotAndDotDot;
+ for (const QString &sourceDir : std::as_const(fixifiedSourceDirs)) {
+ for (const auto &dirEntry : QDirListing(sourceDir, sourceFilesFilter, filters)) {
+ QString &duplicate = fileNames[dirEntry.completeBaseName()];
if (duplicate.isNull()) {
- duplicate = fi.filePath();
+ duplicate = dirEntry.filePath();
} else {
warn_msg(WarnLogic, "%s conflicts with %s", qPrintable(duplicate),
- qPrintable(fi.filePath()));
+ qPrintable(dirEntry.filePath()));
duplicatesFound = true;
}
}
@@ -360,7 +338,7 @@ void NmakeMakefileGenerator::writeImplicitRulesPart(QTextStream &t)
project->variables().remove("QMAKE_RUN_CXX");
project->variables().remove("QMAKE_RUN_CC");
- for (const QString &sourceDir : qAsConst(source_directories)) {
+ for (const QString &sourceDir : std::as_const(source_directories)) {
if (sourceDir.isEmpty())
continue;
QString objDir = var("OBJECTS_DIR");