VS: Refactor handling of "extra" sources in VS >= 10
Create a WriteExtraSource method to handle writing of sources not classified by cmGeneratorTarget for any particular purpose. This will be useful to add special VS-specific handling for some sources.
This commit is contained in:
parent
143b40051a
commit
2df389115e
|
@ -997,6 +997,11 @@ WriteGroupSources(const char* name,
|
||||||
this->WriteString("</ItemGroup>\n", 1);
|
this->WriteString("</ItemGroup>\n", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
|
||||||
|
{
|
||||||
|
this->WriteSource("None", sf);
|
||||||
|
}
|
||||||
|
|
||||||
void cmVisualStudio10TargetGenerator::WriteSource(
|
void cmVisualStudio10TargetGenerator::WriteSource(
|
||||||
std::string const& tool, cmSourceFile const* sf, const char* end)
|
std::string const& tool, cmSourceFile const* sf, const char* end)
|
||||||
{
|
{
|
||||||
|
@ -1157,7 +1162,11 @@ void cmVisualStudio10TargetGenerator::WriteAllSources()
|
||||||
|
|
||||||
std::vector<cmSourceFile const*> extraSources;
|
std::vector<cmSourceFile const*> extraSources;
|
||||||
this->GeneratorTarget->GetExtraSources(extraSources, "");
|
this->GeneratorTarget->GetExtraSources(extraSources, "");
|
||||||
this->WriteSources("None", extraSources);
|
for(std::vector<cmSourceFile const*>::const_iterator
|
||||||
|
si = extraSources.begin(); si != extraSources.end(); ++si)
|
||||||
|
{
|
||||||
|
this->WriteExtraSource(*si);
|
||||||
|
}
|
||||||
|
|
||||||
// Add object library contents as external objects.
|
// Add object library contents as external objects.
|
||||||
std::vector<std::string> objs;
|
std::vector<std::string> objs;
|
||||||
|
|
|
@ -57,6 +57,7 @@ private:
|
||||||
void WriteProjectConfigurations();
|
void WriteProjectConfigurations();
|
||||||
void WriteProjectConfigurationValues();
|
void WriteProjectConfigurationValues();
|
||||||
void WriteMSToolConfigurationValues(std::string const& config);
|
void WriteMSToolConfigurationValues(std::string const& config);
|
||||||
|
void WriteExtraSource(cmSourceFile const* sf);
|
||||||
void WriteSource(std::string const& tool, cmSourceFile const* sf,
|
void WriteSource(std::string const& tool, cmSourceFile const* sf,
|
||||||
const char* end = 0);
|
const char* end = 0);
|
||||||
void WriteSources(std::string const& tool,
|
void WriteSources(std::string const& tool,
|
||||||
|
|
Loading…
Reference in New Issue