summaryrefslogtreecommitdiffstats
path: root/qmake/generators/win32
diff options
context:
space:
mode:
Diffstat (limited to 'qmake/generators/win32')
-rw-r--r--qmake/generators/win32/msvc_objectmodel.cpp1
-rw-r--r--qmake/generators/win32/msvc_vcproj.cpp28
-rw-r--r--qmake/generators/win32/msvc_vcproj.h2
-rw-r--r--qmake/generators/win32/winmakefile.cpp2
4 files changed, 25 insertions, 8 deletions
diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp
index 45f23e52bd..b6fe683d2c 100644
--- a/qmake/generators/win32/msvc_objectmodel.cpp
+++ b/qmake/generators/win32/msvc_objectmodel.cpp
@@ -1991,6 +1991,7 @@ bool VCMIDLTool::parseOption(const char* option)
break;
case 0x5eb7af2: // /header filename
offset = 5;
+ Q_FALLTHROUGH();
case 0x0000358: // /h filename
HeaderFileName = option + offset + 3;
break;
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index fd53ec2a6e..b6f7f20564 100644
--- a/qmake/generators/win32/msvc_vcproj.cpp
+++ b/qmake/generators/win32/msvc_vcproj.cpp
@@ -1521,6 +1521,18 @@ void VcprojGenerator::initDistributionFiles()
vcProject.DistributionFiles.Config = &(vcProject.Configuration);
}
+QString VcprojGenerator::extraCompilerName(const ProString &extraCompiler,
+ const QStringList &inputs,
+ const QStringList &outputs)
+{
+ QString name = project->values(ProKey(extraCompiler + ".name")).join(' ');
+ if (name.isEmpty())
+ name = extraCompiler.toQString();
+ else
+ name = replaceExtraCompilerVariables(name, inputs, outputs, NoShell);
+ return name;
+}
+
void VcprojGenerator::initExtraCompilerOutputs()
{
ProStringList otherFilters;
@@ -1538,13 +1550,16 @@ void VcprojGenerator::initExtraCompilerOutputs()
<< "YACCSOURCES";
const ProStringList &quc = project->values("QMAKE_EXTRA_COMPILERS");
for (ProStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) {
- ProString extracompilerName = project->first(ProKey(*it + ".name"));
- if (extracompilerName.isEmpty())
- extracompilerName = (*it);
+ const ProStringList &inputVars = project->values(ProKey(*it + ".input"));
+ ProStringList inputFiles;
+ for (auto var : inputVars)
+ inputFiles.append(project->values(var.toKey()));
+ const ProStringList &outputs = project->values(ProKey(*it + ".output"));
// Create an extra compiler filter and add the files
VCFilter extraCompile;
- extraCompile.Name = extracompilerName.toQString();
+ extraCompile.Name = extraCompilerName(it->toQString(), inputFiles.toQStringList(),
+ outputs.toQStringList());
extraCompile.ParseFiles = _False;
extraCompile.Filter = "";
extraCompile.Guid = QString(_GUIDExtraCompilerFiles) + "-" + (*it);
@@ -1557,14 +1572,14 @@ void VcprojGenerator::initExtraCompilerOutputs()
if (!outputVar.isEmpty() && otherFilters.contains(outputVar))
continue;
- QString tmp_out = project->first(ProKey(*it + ".output")).toQString();
+ QString tmp_out = project->first(outputs.first().toKey()).toQString();
if (project->values(ProKey(*it + ".CONFIG")).indexOf("combine") != -1) {
// Combined output, only one file result
extraCompile.addFile(Option::fixPathToTargetOS(
replaceExtraCompilerVariables(tmp_out, QString(), QString(), NoShell), false));
} else {
// One output file per input
- const ProStringList &tmp_in = project->values(project->first(ProKey(*it + ".input")).toKey());
+ const ProStringList &tmp_in = project->values(inputVars.first().toKey());
for (int i = 0; i < tmp_in.count(); ++i) {
const QString &filename = tmp_in.at(i).toQString();
if (extraCompilerSources.contains(filename) && !otherFiltersContain(filename))
@@ -1577,7 +1592,6 @@ void VcprojGenerator::initExtraCompilerOutputs()
// build steps there. So, we turn it around and add it to the input files instead,
// provided that the input file variable is not handled already (those in otherFilters
// are handled, so we avoid them).
- const ProStringList &inputVars = project->values(ProKey(*it + ".input"));
for (const ProString &inputVar : inputVars) {
if (!otherFilters.contains(inputVar)) {
const ProStringList &tmp_in = project->values(inputVar.toKey());
diff --git a/qmake/generators/win32/msvc_vcproj.h b/qmake/generators/win32/msvc_vcproj.h
index 55d36c3762..8f38252274 100644
--- a/qmake/generators/win32/msvc_vcproj.h
+++ b/qmake/generators/win32/msvc_vcproj.h
@@ -74,6 +74,8 @@ protected:
bool doDepends() const override { return false; } // Never necessary
using Win32MakefileGenerator::replaceExtraCompilerVariables;
QString replaceExtraCompilerVariables(const QString &, const QStringList &, const QStringList &, ReplaceFor) override;
+ QString extraCompilerName(const ProString &extraCompiler, const QStringList &inputs,
+ const QStringList &outputs);
bool supportsMetaBuild() override { return true; }
bool supportsMergedBuilds() override { return true; }
bool mergeBuildProject(MakefileGenerator *other) override;
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index 8e0c62e13f..b79fd8f250 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -645,7 +645,7 @@ void Win32MakefileGenerator::writeObjectsPart(QTextStream &t)
t << "OBJECTS = " << valList(escapeDependencyPaths(project->values("OBJECTS"))) << Qt::endl;
}
-void Win32MakefileGenerator::writeImplicitRulesPart(QTextStream &t)
+void Win32MakefileGenerator::writeImplicitRulesPart(QTextStream &)
{
}