summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@theqtcompany.com>2015-04-21 15:43:29 +0200
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-04-23 09:49:01 +0000
commit3c1cb24fe4c0cde0cfe4b18f13fea4966ace8a41 (patch)
tree54a3284b7e052049773a62976155bde627da3098 /qmake
parent32341e8ef85f593358db47b3ea58875708f24cda (diff)
fix extra compilers with indirect outputs in VS projects
Evaluate the .output variable of the extra compiler to determine the file extension of its output. The VS project generator needs it to determine the filter that will contain the output file. Change-Id: Iab1e154a712342401e17421c08975fad13967a5b Task-number: QTBUG-45717 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'qmake')
-rw-r--r--qmake/generators/win32/msvc_vcproj.cpp21
-rw-r--r--qmake/generators/win32/msvc_vcproj.h2
2 files changed, 21 insertions, 2 deletions
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index 0d78766606..1fa117afda 100644
--- a/qmake/generators/win32/msvc_vcproj.cpp
+++ b/qmake/generators/win32/msvc_vcproj.cpp
@@ -421,6 +421,24 @@ bool VcprojGenerator::isStandardSuffix(const QString &suffix) const
return false;
}
+ProString VcprojGenerator::firstInputFileName(const ProString &extraCompilerName) const
+{
+ foreach (const ProString &var, project->values(ProKey(extraCompilerName + ".input"))) {
+ const ProStringList &files = project->values(var.toKey());
+ if (!files.isEmpty())
+ return files.first();
+ }
+ return ProString();
+}
+
+QString VcprojGenerator::firstExpandedOutputFileName(const ProString &extraCompilerName)
+{
+ const ProString firstOutput = project->first(ProKey(extraCompilerName + ".output"));
+ return replaceExtraCompilerVariables(firstOutput.toQString(),
+ firstInputFileName(extraCompilerName).toQString(),
+ QString(), NoShell);
+}
+
ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QString, QString> &projLookup,
QHash<QString, QString> &projGuids,
QHash<VcsolutionDepend *, QStringList> &extraSubdirs,
@@ -1642,10 +1660,9 @@ void VcprojGenerator::initExtraCompilerOutputs()
extraCompile.Filter = "";
extraCompile.Guid = QString(_GUIDExtraCompilerFiles) + "-" + (*it);
-
// If the extra compiler has a variable_out set the output file
// is added to an other file list, and does not need its own..
- bool addOnInput = hasBuiltinCompiler(project->first(ProKey(*it + ".output")).toQString());
+ bool addOnInput = hasBuiltinCompiler(firstExpandedOutputFileName(*it));
const ProString &tmp_other_out = project->first(ProKey(*it + ".variable_out"));
if (!tmp_other_out.isEmpty() && !addOnInput)
continue;
diff --git a/qmake/generators/win32/msvc_vcproj.h b/qmake/generators/win32/msvc_vcproj.h
index 3396ea4986..3f99e02e92 100644
--- a/qmake/generators/win32/msvc_vcproj.h
+++ b/qmake/generators/win32/msvc_vcproj.h
@@ -135,6 +135,8 @@ private:
QUuid increaseUUID(const QUuid &id);
QString retrievePlatformToolSet() const;
bool isStandardSuffix(const QString &suffix) const;
+ ProString firstInputFileName(const ProString &extraCompilerName) const;
+ QString firstExpandedOutputFileName(const ProString &extraCompilerName);
friend class VCFilter;
};