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>
This commit is contained in:
parent
32341e8ef8
commit
3c1cb24fe4
@ -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;
|
||||
|
@ -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;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user