Revert "fix vcxproj generation for CONFIG-=flat"
This reverts commit e5a8134765.
A much simpler fix for QTBUG-41746 is about to follow.
Change-Id: I1eea1785e00b4d7d470108d8dc3272a2af438ef4
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
bb10
parent
e29496e5cf
commit
7af4d5da90
|
|
@ -343,8 +343,8 @@ static QStringList unquote(const QStringList &values)
|
|||
|
||||
// Tree file generation ---------------------------------------------
|
||||
void XTreeNode::generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString &tagName,
|
||||
VCProject &tool, const QString &filter, const QString &filterId) {
|
||||
|
||||
VCProject &tool, const QString &filter)
|
||||
{
|
||||
if (children.size()) {
|
||||
// Filter
|
||||
QString tempFilterName;
|
||||
|
|
@ -364,24 +364,24 @@ void XTreeNode::generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString
|
|||
if ((*it)->children.size())
|
||||
{
|
||||
if ( !tempFilterName.isEmpty() )
|
||||
(*it)->generateXML(xml, xmlFilter, it.key(), tool, tempFilterName, filterId);
|
||||
(*it)->generateXML(xml, xmlFilter, it.key(), tool, tempFilterName);
|
||||
else
|
||||
(*it)->generateXML(xml, xmlFilter, it.key(), tool, filter, filterId);
|
||||
(*it)->generateXML(xml, xmlFilter, it.key(), tool, filter);
|
||||
}
|
||||
// Second round, do leafs
|
||||
for (it = children.constBegin(); it != end; ++it)
|
||||
if (!(*it)->children.size())
|
||||
{
|
||||
if ( !tempFilterName.isEmpty() )
|
||||
(*it)->generateXML(xml, xmlFilter, it.key(), tool, tempFilterName, filterId);
|
||||
(*it)->generateXML(xml, xmlFilter, it.key(), tool, tempFilterName);
|
||||
else
|
||||
(*it)->generateXML(xml, xmlFilter, it.key(), tool, filter, filterId);
|
||||
(*it)->generateXML(xml, xmlFilter, it.key(), tool, filter);
|
||||
}
|
||||
} else {
|
||||
// Leaf
|
||||
xml << tag(_ItemGroup);
|
||||
xmlFilter << tag(_ItemGroup);
|
||||
VCXProjectWriter::outputFileConfigs(tool, xml, xmlFilter, info, filter, filterId);
|
||||
VCXProjectWriter::outputFileConfigs(tool, xml, xmlFilter, info, filter);
|
||||
xmlFilter << closetag();
|
||||
xml << closetag();
|
||||
}
|
||||
|
|
@ -389,14 +389,15 @@ void XTreeNode::generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString
|
|||
|
||||
// Flat file generation ---------------------------------------------
|
||||
void XFlatNode::generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString &/*tagName*/,
|
||||
VCProject &tool, const QString &filter, const QString &filterId) {
|
||||
VCProject &tool, const QString &filter)
|
||||
{
|
||||
if (children.size()) {
|
||||
ChildrenMapFlat::ConstIterator it = children.constBegin();
|
||||
ChildrenMapFlat::ConstIterator end = children.constEnd();
|
||||
xml << tag(_ItemGroup);
|
||||
xmlFilter << tag(_ItemGroup);
|
||||
for (; it != end; ++it) {
|
||||
VCXProjectWriter::outputFileConfigs(tool, xml, xmlFilter, (*it), filter, filterId);
|
||||
VCXProjectWriter::outputFileConfigs(tool, xml, xmlFilter, (*it), filter);
|
||||
}
|
||||
xml << closetag();
|
||||
xmlFilter << closetag();
|
||||
|
|
@ -1850,21 +1851,20 @@ void VCXProjectWriter::outputFilter(VCProject &project, XmlOutput &xml, XmlOutpu
|
|||
if (!root->hasElements())
|
||||
return;
|
||||
|
||||
root->generateXML(xml, xmlFilter, "", project, filtername, filtername); // output root tree
|
||||
root->generateXML(xml, xmlFilter, "", project, filtername); // output root tree
|
||||
}
|
||||
|
||||
// Output all configurations (by filtername) for a file (by info)
|
||||
// A filters config output is in VCFilter.outputFileConfig()
|
||||
void VCXProjectWriter::outputFileConfigs(VCProject &project, XmlOutput &xml, XmlOutput &xmlFilter,
|
||||
const VCFilterFile &info, const QString &filtername,
|
||||
const QString &filterId)
|
||||
const VCFilterFile &info, const QString &filtername)
|
||||
{
|
||||
// We need to check if the file has any custom build step.
|
||||
// If there is one then it has to be included with "CustomBuild Include"
|
||||
bool hasCustomBuildStep = false;
|
||||
QVarLengthArray<OutputFilterData> data(project.SingleProjects.count());
|
||||
for (int i = 0; i < project.SingleProjects.count(); ++i) {
|
||||
data[i].filter = project.SingleProjects.at(i).filterByName(filterId);
|
||||
data[i].filter = project.SingleProjects.at(i).filterByName(filtername);
|
||||
if (!data[i].filter.Config) // only if the filter is not empty
|
||||
continue;
|
||||
VCFilter &filter = data[i].filter;
|
||||
|
|
@ -1886,7 +1886,7 @@ void VCXProjectWriter::outputFileConfigs(VCProject &project, XmlOutput &xml, Xml
|
|||
|
||||
bool fileAdded = false;
|
||||
for (int i = 0; i < project.SingleProjects.count(); ++i) {
|
||||
const VCFilter &filter = project.SingleProjects.at(i).filterByName(filterId);
|
||||
const VCFilter &filter = project.SingleProjects.at(i).filterByName(filtername);
|
||||
if (!filter.Config) // only if the filter is not empty
|
||||
continue;
|
||||
if (outputFileConfig(&data[i], xml, xmlFilter, info.file, fileAdded,
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ public:
|
|||
virtual void addElement(const QString &filepath, const VCFilterFile &allInfo) = 0;
|
||||
virtual void removeElements()= 0;
|
||||
virtual void generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString &tagName,
|
||||
VCProject &tool, const QString &filter, const QString &filterId) = 0;
|
||||
VCProject &tool, const QString &filter) = 0;
|
||||
virtual bool hasElements() = 0;
|
||||
};
|
||||
|
||||
|
|
@ -108,7 +108,7 @@ public:
|
|||
}
|
||||
|
||||
void generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString &tagName, VCProject &tool,
|
||||
const QString &filter, const QString &filterId);
|
||||
const QString &filter);
|
||||
bool hasElements() {
|
||||
return children.size() != 0;
|
||||
}
|
||||
|
|
@ -149,7 +149,7 @@ public:
|
|||
}
|
||||
|
||||
void generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString &tagName, VCProject &proj,
|
||||
const QString &filter, const QString &filterId);
|
||||
const QString &filter);
|
||||
bool hasElements() {
|
||||
return children.size() != 0;
|
||||
}
|
||||
|
|
@ -183,7 +183,8 @@ private:
|
|||
|
||||
static void addFilters(VCProject &project, XmlOutput &xmlFilter, const QString &filterName);
|
||||
static void outputFilter(VCProject &project, XmlOutput &xml, XmlOutput &xmlFilter, const QString &filtername);
|
||||
static void outputFileConfigs(VCProject &project, XmlOutput &xml, XmlOutput &xmlFilter, const VCFilterFile &info, const QString &filtername, const QString &filterId);
|
||||
static void outputFileConfigs(VCProject &project, XmlOutput &xml, XmlOutput &xmlFilter,
|
||||
const VCFilterFile &info, const QString &filtername);
|
||||
static bool outputFileConfig(OutputFilterData *d, XmlOutput &xml, XmlOutput &xmlFilter, const QString &filename, bool fileAdded, bool hasCustomBuildStep);
|
||||
static void outputFileConfig(XmlOutput &xml, XmlOutput &xmlFilter, const QString &fileName, const QString &filterName);
|
||||
static QString generateCondition(const VCConfiguration &config);
|
||||
|
|
|
|||
Loading…
Reference in New Issue