cmGeneratorTarget: Constify cmSourceFile* in containers.

Some of them will be used with other APIs which require value_type
to be cmSourceFile const*.
This commit is contained in:
Stephen Kelly 2014-03-12 23:06:05 +01:00
parent c725bb3cbd
commit 9ad804ac7b
13 changed files with 84 additions and 75 deletions

View File

@ -97,7 +97,7 @@ struct DoAccept
template<> template<>
struct DoAccept<true> struct DoAccept<true>
{ {
static void Do(std::vector<cmSourceFile*>& files, cmSourceFile* f) static void Do(std::vector<cmSourceFile const*>& files, cmSourceFile* f)
{ {
files.push_back(f); files.push_back(f);
} }
@ -120,7 +120,7 @@ struct DoAccept<true>
}; };
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
template<typename Tag, typename DataType = std::vector<cmSourceFile*> > template<typename Tag, typename DataType = std::vector<cmSourceFile const*> >
struct TagVisitor struct TagVisitor
{ {
DataType& Data; DataType& Data;
@ -306,7 +306,8 @@ static void handleSystemIncludesDep(cmMakefile *mf, cmTarget* depTgt,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void void
cmGeneratorTarget::GetObjectSources(std::vector<cmSourceFile*> &data) const cmGeneratorTarget
::GetObjectSources(std::vector<cmSourceFile const*> &data) const
{ {
IMPLEMENT_VISIT(ObjectSources); IMPLEMENT_VISIT(ObjectSources);
if (this->Target->GetType() == cmTarget::OBJECT_LIBRARY) if (this->Target->GetType() == cmTarget::OBJECT_LIBRARY)
@ -342,34 +343,39 @@ bool cmGeneratorTarget::HasExplicitObjectName(cmSourceFile const* file) const
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmGeneratorTarget::GetIDLSources(std::vector<cmSourceFile*>& data) const void cmGeneratorTarget
::GetIDLSources(std::vector<cmSourceFile const*>& data) const
{ {
IMPLEMENT_VISIT(IDLSources); IMPLEMENT_VISIT(IDLSources);
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void void
cmGeneratorTarget::GetHeaderSources(std::vector<cmSourceFile*>& data) const cmGeneratorTarget
::GetHeaderSources(std::vector<cmSourceFile const*>& data) const
{ {
IMPLEMENT_VISIT(HeaderSources); IMPLEMENT_VISIT(HeaderSources);
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmGeneratorTarget::GetExtraSources(std::vector<cmSourceFile*>& data) const void cmGeneratorTarget
::GetExtraSources(std::vector<cmSourceFile const*>& data) const
{ {
IMPLEMENT_VISIT(ExtraSources); IMPLEMENT_VISIT(ExtraSources);
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void void
cmGeneratorTarget::GetCustomCommands(std::vector<cmSourceFile*>& data) const cmGeneratorTarget
::GetCustomCommands(std::vector<cmSourceFile const*>& data) const
{ {
IMPLEMENT_VISIT(CustomCommands); IMPLEMENT_VISIT(CustomCommands);
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void void
cmGeneratorTarget::GetExternalObjects(std::vector<cmSourceFile*>& data) const cmGeneratorTarget
::GetExternalObjects(std::vector<cmSourceFile const*>& data) const
{ {
IMPLEMENT_VISIT(ExternalObjects); IMPLEMENT_VISIT(ExternalObjects);
} }
@ -384,7 +390,8 @@ cmGeneratorTarget::GetExpectedResxHeaders(std::set<std::string>& srcs) const
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmGeneratorTarget::GetResxSources(std::vector<cmSourceFile*>& srcs) const void cmGeneratorTarget
::GetResxSources(std::vector<cmSourceFile const*>& srcs) const
{ {
ResxData data; ResxData data;
IMPLEMENT_VISIT_IMPL(Resx, COMMA cmGeneratorTarget::ResxData) IMPLEMENT_VISIT_IMPL(Resx, COMMA cmGeneratorTarget::ResxData)
@ -570,7 +577,7 @@ cmGeneratorTarget::UseObjectLibraries(std::vector<std::string>& objs) const
cmTarget* objLib = *ti; cmTarget* objLib = *ti;
cmGeneratorTarget* ogt = cmGeneratorTarget* ogt =
this->GlobalGenerator->GetGeneratorTarget(objLib); this->GlobalGenerator->GetGeneratorTarget(objLib);
for(std::vector<cmSourceFile*>::const_iterator for(std::vector<cmSourceFile const*>::const_iterator
si = ogt->ObjectSources.begin(); si = ogt->ObjectSources.begin();
si != ogt->ObjectSources.end(); ++si) si != ogt->ObjectSources.end(); ++si)
{ {

View File

@ -32,19 +32,19 @@ public:
bool GetPropertyAsBool(const std::string& prop) const; bool GetPropertyAsBool(const std::string& prop) const;
void GetSourceFiles(std::vector<cmSourceFile*>& files) const; void GetSourceFiles(std::vector<cmSourceFile*>& files) const;
void GetObjectSources(std::vector<cmSourceFile*> &) const; void GetObjectSources(std::vector<cmSourceFile const*> &) const;
const std::string& GetObjectName(cmSourceFile const* file); const std::string& GetObjectName(cmSourceFile const* file);
void AddObject(cmSourceFile const* sf, std::string const&name); void AddObject(cmSourceFile const* sf, std::string const&name);
bool HasExplicitObjectName(cmSourceFile const* file) const; bool HasExplicitObjectName(cmSourceFile const* file) const;
void AddExplicitObjectName(cmSourceFile const* sf); void AddExplicitObjectName(cmSourceFile const* sf);
void GetResxSources(std::vector<cmSourceFile*>&) const; void GetResxSources(std::vector<cmSourceFile const*>&) const;
void GetIDLSources(std::vector<cmSourceFile*>&) const; void GetIDLSources(std::vector<cmSourceFile const*>&) const;
void GetExternalObjects(std::vector<cmSourceFile*>&) const; void GetExternalObjects(std::vector<cmSourceFile const*>&) const;
void GetHeaderSources(std::vector<cmSourceFile*>&) const; void GetHeaderSources(std::vector<cmSourceFile const*>&) const;
void GetExtraSources(std::vector<cmSourceFile*>&) const; void GetExtraSources(std::vector<cmSourceFile const*>&) const;
void GetCustomCommands(std::vector<cmSourceFile*>&) const; void GetCustomCommands(std::vector<cmSourceFile const*>&) const;
void GetExpectedResxHeaders(std::set<std::string>&) const; void GetExpectedResxHeaders(std::set<std::string>&) const;
cmTarget* Target; cmTarget* Target;
@ -117,7 +117,7 @@ public:
struct ResxData { struct ResxData {
mutable std::set<std::string> ExpectedResxHeaders; mutable std::set<std::string> ExpectedResxHeaders;
mutable std::vector<cmSourceFile*> ResxSources; mutable std::vector<cmSourceFile const*> ResxSources;
}; };
private: private:
friend class cmTargetTraceDependencies; friend class cmTargetTraceDependencies;
@ -127,7 +127,7 @@ private:
std::map<cmSourceFile const*, std::string> Objects; std::map<cmSourceFile const*, std::string> Objects;
std::set<cmSourceFile const*> ExplicitObjectName; std::set<cmSourceFile const*> ExplicitObjectName;
mutable std::vector<cmSourceFile*> ObjectSources; mutable std::vector<cmSourceFile const*> ObjectSources;
std::vector<cmTarget*> ObjectLibraries; std::vector<cmTarget*> ObjectLibraries;
mutable std::map<std::string, std::vector<std::string> > SystemIncludesCache; mutable std::map<std::string, std::vector<std::string> > SystemIncludesCache;

View File

@ -634,14 +634,14 @@ std::string cmGlobalNinjaGenerator::GetEditCacheCommand() const
// TODO: Refactor to combine with cmGlobalUnixMakefileGenerator3 impl. // TODO: Refactor to combine with cmGlobalUnixMakefileGenerator3 impl.
void cmGlobalNinjaGenerator::ComputeTargetObjects(cmGeneratorTarget* gt) const void cmGlobalNinjaGenerator::ComputeTargetObjects(cmGeneratorTarget* gt) const
{ {
std::vector<cmSourceFile*> objectSources; std::vector<cmSourceFile const*> objectSources;
gt->GetObjectSources(objectSources); gt->GetObjectSources(objectSources);
// Compute the name of each object file. // Compute the name of each object file.
for(std::vector<cmSourceFile*>::iterator for(std::vector<cmSourceFile const*>::iterator
si = objectSources.begin(); si = objectSources.begin();
si != objectSources.end(); ++si) si != objectSources.end(); ++si)
{ {
cmSourceFile* sf = *si; cmSourceFile const* sf = *si;
std::string objectName = gt->LocalGenerator std::string objectName = gt->LocalGenerator
->GetObjectFileNameWithoutTarget(*sf, gt->ObjectDirectory); ->GetObjectFileNameWithoutTarget(*sf, gt->ObjectDirectory);
gt->AddObject(sf, objectName); gt->AddObject(sf, objectName);

View File

@ -108,14 +108,14 @@ void
cmGlobalUnixMakefileGenerator3 cmGlobalUnixMakefileGenerator3
::ComputeTargetObjects(cmGeneratorTarget* gt) const ::ComputeTargetObjects(cmGeneratorTarget* gt) const
{ {
std::vector<cmSourceFile*> objectSources; std::vector<cmSourceFile const*> objectSources;
gt->GetObjectSources(objectSources); gt->GetObjectSources(objectSources);
// Compute the name of each object file. // Compute the name of each object file.
for(std::vector<cmSourceFile*>::iterator for(std::vector<cmSourceFile const*>::iterator
si = objectSources.begin(); si = objectSources.begin();
si != objectSources.end(); ++si) si != objectSources.end(); ++si)
{ {
cmSourceFile* sf = *si; cmSourceFile const* sf = *si;
std::string objectName = gt->LocalGenerator std::string objectName = gt->LocalGenerator
->GetObjectFileNameWithoutTarget(*sf, gt->ObjectDirectory); ->GetObjectFileNameWithoutTarget(*sf, gt->ObjectDirectory);
gt->AddObject(sf, objectName); gt->AddObject(sf, objectName);

View File

@ -129,13 +129,13 @@ cmGlobalVisualStudioGenerator
// Count the number of object files with each name. Note that // Count the number of object files with each name. Note that
// windows file names are not case sensitive. // windows file names are not case sensitive.
std::map<std::string, int> counts; std::map<std::string, int> counts;
std::vector<cmSourceFile*> objectSources; std::vector<cmSourceFile const*> objectSources;
gt->GetObjectSources(objectSources); gt->GetObjectSources(objectSources);
for(std::vector<cmSourceFile*>::const_iterator for(std::vector<cmSourceFile const*>::const_iterator
si = objectSources.begin(); si = objectSources.begin();
si != objectSources.end(); ++si) si != objectSources.end(); ++si)
{ {
cmSourceFile* sf = *si; cmSourceFile const* sf = *si;
std::string objectNameLower = cmSystemTools::LowerCase( std::string objectNameLower = cmSystemTools::LowerCase(
cmSystemTools::GetFilenameWithoutLastExtension(sf->GetFullPath())); cmSystemTools::GetFilenameWithoutLastExtension(sf->GetFullPath()));
objectNameLower += ".obj"; objectNameLower += ".obj";
@ -144,11 +144,11 @@ cmGlobalVisualStudioGenerator
// For all source files producing duplicate names we need unique // For all source files producing duplicate names we need unique
// object name computation. // object name computation.
for(std::vector<cmSourceFile*>::const_iterator for(std::vector<cmSourceFile const*>::const_iterator
si = objectSources.begin(); si = objectSources.begin();
si != objectSources.end(); ++si) si != objectSources.end(); ++si)
{ {
cmSourceFile* sf = *si; cmSourceFile const* sf = *si;
std::string objectName = std::string objectName =
cmSystemTools::GetFilenameWithoutLastExtension(sf->GetFullPath()); cmSystemTools::GetFilenameWithoutLastExtension(sf->GetFullPath());
objectName += ".obj"; objectName += ".obj";

View File

@ -3944,13 +3944,13 @@ cmGlobalXCodeGenerator
// to avoid exact duplicate file names. Note that Mac file names are not // to avoid exact duplicate file names. Note that Mac file names are not
// typically case sensitive, hence the LowerCase. // typically case sensitive, hence the LowerCase.
std::map<std::string, int> counts; std::map<std::string, int> counts;
std::vector<cmSourceFile*> objectSources; std::vector<cmSourceFile const*> objectSources;
gt->GetObjectSources(objectSources); gt->GetObjectSources(objectSources);
for(std::vector<cmSourceFile*>::const_iterator for(std::vector<cmSourceFile const*>::const_iterator
si = objectSources.begin(); si = objectSources.begin();
si != objectSources.end(); ++si) si != objectSources.end(); ++si)
{ {
cmSourceFile* sf = *si; cmSourceFile const* sf = *si;
std::string objectName = std::string objectName =
cmSystemTools::GetFilenameWithoutLastExtension(sf->GetFullPath()); cmSystemTools::GetFilenameWithoutLastExtension(sf->GetFullPath());
objectName += ".o"; objectName += ".o";

View File

@ -185,7 +185,7 @@ GetLocalObjectFiles(std::map<std::string, LocalObjectInfo> &localObjectFiles)
{ {
continue; continue;
} }
std::vector<cmSourceFile*> objectSources; std::vector<cmSourceFile const*> objectSources;
gt->GetObjectSources(objectSources); gt->GetObjectSources(objectSources);
// Compute full path to object file directory for this target. // Compute full path to object file directory for this target.
std::string dir_max; std::string dir_max;
@ -194,11 +194,11 @@ GetLocalObjectFiles(std::map<std::string, LocalObjectInfo> &localObjectFiles)
dir_max += this->GetTargetDirectory(*gt->Target); dir_max += this->GetTargetDirectory(*gt->Target);
dir_max += "/"; dir_max += "/";
// Compute the name of each object file. // Compute the name of each object file.
for(std::vector<cmSourceFile*>::iterator for(std::vector<cmSourceFile const*>::iterator
si = objectSources.begin(); si = objectSources.begin();
si != objectSources.end(); ++si) si != objectSources.end(); ++si)
{ {
cmSourceFile* sf = *si; cmSourceFile const* sf = *si;
bool hasSourceExtension = true; bool hasSourceExtension = true;
std::string objectName = this->GetObjectFileNameWithoutTarget(*sf, std::string objectName = this->GetObjectFileNameWithoutTarget(*sf,
dir_max, dir_max,

View File

@ -153,9 +153,9 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules()
// First generate the object rule files. Save a list of all object // First generate the object rule files. Save a list of all object
// files for this target. // files for this target.
std::vector<cmSourceFile*> customCommands; std::vector<cmSourceFile const*> customCommands;
this->GeneratorTarget->GetCustomCommands(customCommands); this->GeneratorTarget->GetCustomCommands(customCommands);
for(std::vector<cmSourceFile*>::const_iterator for(std::vector<cmSourceFile const*>::const_iterator
si = customCommands.begin(); si = customCommands.begin();
si != customCommands.end(); ++si) si != customCommands.end(); ++si)
{ {
@ -176,27 +176,27 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules()
} }
} }
} }
std::vector<cmSourceFile*> headerSources; std::vector<cmSourceFile const*> headerSources;
this->GeneratorTarget->GetHeaderSources(headerSources); this->GeneratorTarget->GetHeaderSources(headerSources);
this->OSXBundleGenerator->GenerateMacOSXContentStatements( this->OSXBundleGenerator->GenerateMacOSXContentStatements(
headerSources, headerSources,
this->MacOSXContentGenerator); this->MacOSXContentGenerator);
std::vector<cmSourceFile*> extraSources; std::vector<cmSourceFile const*> extraSources;
this->GeneratorTarget->GetExtraSources(extraSources); this->GeneratorTarget->GetExtraSources(extraSources);
this->OSXBundleGenerator->GenerateMacOSXContentStatements( this->OSXBundleGenerator->GenerateMacOSXContentStatements(
extraSources, extraSources,
this->MacOSXContentGenerator); this->MacOSXContentGenerator);
std::vector<cmSourceFile*> externalObjects; std::vector<cmSourceFile const*> externalObjects;
this->GeneratorTarget->GetExternalObjects(externalObjects); this->GeneratorTarget->GetExternalObjects(externalObjects);
for(std::vector<cmSourceFile*>::const_iterator for(std::vector<cmSourceFile const*>::const_iterator
si = externalObjects.begin(); si = externalObjects.begin();
si != externalObjects.end(); ++si) si != externalObjects.end(); ++si)
{ {
this->ExternalObjects.push_back((*si)->GetFullPath()); this->ExternalObjects.push_back((*si)->GetFullPath());
} }
std::vector<cmSourceFile*> objectSources; std::vector<cmSourceFile const*> objectSources;
this->GeneratorTarget->GetObjectSources(objectSources); this->GeneratorTarget->GetObjectSources(objectSources);
for(std::vector<cmSourceFile*>::const_iterator for(std::vector<cmSourceFile const*>::const_iterator
si = objectSources.begin(); si != objectSources.end(); ++si) si = objectSources.begin(); si != objectSources.end(); ++si)
{ {
// Generate this object file's rule file. // Generate this object file's rule file.

View File

@ -480,36 +480,36 @@ cmNinjaTargetGenerator
<< this->GetTargetName() << this->GetTargetName()
<< "\n\n"; << "\n\n";
std::vector<cmSourceFile*> customCommands; std::vector<cmSourceFile const*> customCommands;
this->GeneratorTarget->GetCustomCommands(customCommands); this->GeneratorTarget->GetCustomCommands(customCommands);
for(std::vector<cmSourceFile*>::const_iterator for(std::vector<cmSourceFile const*>::const_iterator
si = customCommands.begin(); si = customCommands.begin();
si != customCommands.end(); ++si) si != customCommands.end(); ++si)
{ {
cmCustomCommand const* cc = (*si)->GetCustomCommand(); cmCustomCommand const* cc = (*si)->GetCustomCommand();
this->GetLocalGenerator()->AddCustomCommandTarget(cc, this->GetTarget()); this->GetLocalGenerator()->AddCustomCommandTarget(cc, this->GetTarget());
} }
std::vector<cmSourceFile*> headerSources; std::vector<cmSourceFile const*> headerSources;
this->GeneratorTarget->GetHeaderSources(headerSources); this->GeneratorTarget->GetHeaderSources(headerSources);
this->OSXBundleGenerator->GenerateMacOSXContentStatements( this->OSXBundleGenerator->GenerateMacOSXContentStatements(
headerSources, headerSources,
this->MacOSXContentGenerator); this->MacOSXContentGenerator);
std::vector<cmSourceFile*> extraSources; std::vector<cmSourceFile const*> extraSources;
this->GeneratorTarget->GetExtraSources(extraSources); this->GeneratorTarget->GetExtraSources(extraSources);
this->OSXBundleGenerator->GenerateMacOSXContentStatements( this->OSXBundleGenerator->GenerateMacOSXContentStatements(
extraSources, extraSources,
this->MacOSXContentGenerator); this->MacOSXContentGenerator);
std::vector<cmSourceFile*> externalObjects; std::vector<cmSourceFile const*> externalObjects;
this->GeneratorTarget->GetExternalObjects(externalObjects); this->GeneratorTarget->GetExternalObjects(externalObjects);
for(std::vector<cmSourceFile*>::const_iterator for(std::vector<cmSourceFile const*>::const_iterator
si = externalObjects.begin(); si = externalObjects.begin();
si != externalObjects.end(); ++si) si != externalObjects.end(); ++si)
{ {
this->Objects.push_back(this->GetSourceFilePath(*si)); this->Objects.push_back(this->GetSourceFilePath(*si));
} }
std::vector<cmSourceFile*> objectSources; std::vector<cmSourceFile const*> objectSources;
this->GeneratorTarget->GetObjectSources(objectSources); this->GeneratorTarget->GetObjectSources(objectSources);
for(std::vector<cmSourceFile*>::const_iterator for(std::vector<cmSourceFile const*>::const_iterator
si = objectSources.begin(); si != objectSources.end(); ++si) si = objectSources.begin(); si != objectSources.end(); ++si)
{ {
this->WriteObjectBuildStatement(*si); this->WriteObjectBuildStatement(*si);
@ -570,9 +570,9 @@ cmNinjaTargetGenerator
} }
// Add order-only dependencies on custom command outputs. // Add order-only dependencies on custom command outputs.
std::vector<cmSourceFile*> customCommands; std::vector<cmSourceFile const*> customCommands;
this->GeneratorTarget->GetCustomCommands(customCommands); this->GeneratorTarget->GetCustomCommands(customCommands);
for(std::vector<cmSourceFile*>::const_iterator for(std::vector<cmSourceFile const*>::const_iterator
si = customCommands.begin(); si = customCommands.begin();
si != customCommands.end(); ++si) si != customCommands.end(); ++si)
{ {

View File

@ -190,13 +190,14 @@ void cmOSXBundleGenerator::CreateCFBundle(const std::string& targetName,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void void
cmOSXBundleGenerator:: cmOSXBundleGenerator::
GenerateMacOSXContentStatements(std::vector<cmSourceFile*> const& sources, GenerateMacOSXContentStatements(
MacOSXContentGeneratorType* generator) std::vector<cmSourceFile const*> const& sources,
MacOSXContentGeneratorType* generator)
{ {
if (this->MustSkip()) if (this->MustSkip())
return; return;
for(std::vector<cmSourceFile*>::const_iterator for(std::vector<cmSourceFile const*>::const_iterator
si = sources.begin(); si != sources.end(); ++si) si = sources.begin(); si != sources.end(); ++si)
{ {
cmGeneratorTarget::SourceFileFlags tsFlags = cmGeneratorTarget::SourceFileFlags tsFlags =

View File

@ -49,7 +49,7 @@ public:
}; };
void GenerateMacOSXContentStatements( void GenerateMacOSXContentStatements(
std::vector<cmSourceFile*> const& sources, std::vector<cmSourceFile const*> const& sources,
MacOSXContentGeneratorType* generator); MacOSXContentGeneratorType* generator);
std::string InitMacOSXContentDirectory(const char* pkgloc); std::string InitMacOSXContentDirectory(const char* pkgloc);

View File

@ -377,12 +377,12 @@ void cmVisualStudio10TargetGenerator::WriteDotNetReferences()
void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup() void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup()
{ {
std::vector<cmSourceFile*> resxObjs; std::vector<cmSourceFile const*> resxObjs;
this->GeneratorTarget->GetResxSources(resxObjs); this->GeneratorTarget->GetResxSources(resxObjs);
if(!resxObjs.empty()) if(!resxObjs.empty())
{ {
this->WriteString("<ItemGroup>\n", 1); this->WriteString("<ItemGroup>\n", 1);
for(std::vector<cmSourceFile*>::const_iterator oi = resxObjs.begin(); for(std::vector<cmSourceFile const*>::const_iterator oi = resxObjs.begin();
oi != resxObjs.end(); ++oi) oi != resxObjs.end(); ++oi)
{ {
std::string obj = (*oi)->GetFullPath(); std::string obj = (*oi)->GetFullPath();
@ -551,9 +551,9 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues()
void cmVisualStudio10TargetGenerator::WriteCustomCommands() void cmVisualStudio10TargetGenerator::WriteCustomCommands()
{ {
this->SourcesVisited.clear(); this->SourcesVisited.clear();
std::vector<cmSourceFile*> customCommands; std::vector<cmSourceFile const*> customCommands;
this->GeneratorTarget->GetCustomCommands(customCommands); this->GeneratorTarget->GetCustomCommands(customCommands);
for(std::vector<cmSourceFile*>::const_iterator for(std::vector<cmSourceFile const*>::const_iterator
si = customCommands.begin(); si = customCommands.begin();
si != customCommands.end(); ++si) si != customCommands.end(); ++si)
{ {
@ -746,12 +746,12 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
this->WriteGroupSources(ti->first.c_str(), ti->second, sourceGroups); this->WriteGroupSources(ti->first.c_str(), ti->second, sourceGroups);
} }
std::vector<cmSourceFile*> resxObjs; std::vector<cmSourceFile const*> resxObjs;
this->GeneratorTarget->GetResxSources(resxObjs); this->GeneratorTarget->GetResxSources(resxObjs);
if(!resxObjs.empty()) if(!resxObjs.empty())
{ {
this->WriteString("<ItemGroup>\n", 1); this->WriteString("<ItemGroup>\n", 1);
for(std::vector<cmSourceFile*>::const_iterator oi = resxObjs.begin(); for(std::vector<cmSourceFile const*>::const_iterator oi = resxObjs.begin();
oi != resxObjs.end(); ++oi) oi != resxObjs.end(); ++oi)
{ {
std::string obj = (*oi)->GetFullPath(); std::string obj = (*oi)->GetFullPath();
@ -902,7 +902,7 @@ WriteGroupSources(const char* name,
for(ToolSources::const_iterator s = sources.begin(); for(ToolSources::const_iterator s = sources.begin();
s != sources.end(); ++s) s != sources.end(); ++s)
{ {
cmSourceFile* sf = s->SourceFile; cmSourceFile const* sf = s->SourceFile;
std::string const& source = sf->GetFullPath(); std::string const& source = sf->GetFullPath();
cmSourceGroup* sourceGroup = cmSourceGroup* sourceGroup =
this->Makefile->FindSourceGroup(source.c_str(), sourceGroups); this->Makefile->FindSourceGroup(source.c_str(), sourceGroups);
@ -985,9 +985,9 @@ void cmVisualStudio10TargetGenerator::WriteSource(
} }
void cmVisualStudio10TargetGenerator::WriteSources( void cmVisualStudio10TargetGenerator::WriteSources(
const char* tool, std::vector<cmSourceFile*> const& sources) const char* tool, std::vector<cmSourceFile const*> const& sources)
{ {
for(std::vector<cmSourceFile*>::const_iterator for(std::vector<cmSourceFile const*>::const_iterator
si = sources.begin(); si != sources.end(); ++si) si = sources.begin(); si != sources.end(); ++si)
{ {
this->WriteSource(tool, *si); this->WriteSource(tool, *si);
@ -1002,16 +1002,16 @@ void cmVisualStudio10TargetGenerator::WriteAllSources()
} }
this->WriteString("<ItemGroup>\n", 1); this->WriteString("<ItemGroup>\n", 1);
std::vector<cmSourceFile*> headerSources; std::vector<cmSourceFile const*> headerSources;
this->GeneratorTarget->GetHeaderSources(headerSources); this->GeneratorTarget->GetHeaderSources(headerSources);
this->WriteSources("ClInclude", headerSources); this->WriteSources("ClInclude", headerSources);
std::vector<cmSourceFile*> idlSources; std::vector<cmSourceFile const*> idlSources;
this->GeneratorTarget->GetIDLSources(idlSources); this->GeneratorTarget->GetIDLSources(idlSources);
this->WriteSources("Midl", idlSources); this->WriteSources("Midl", idlSources);
std::vector<cmSourceFile*> objectSources; std::vector<cmSourceFile const*> objectSources;
this->GeneratorTarget->GetObjectSources(objectSources); this->GeneratorTarget->GetObjectSources(objectSources);
for(std::vector<cmSourceFile*>::const_iterator for(std::vector<cmSourceFile const*>::const_iterator
si = objectSources.begin(); si = objectSources.begin();
si != objectSources.end(); ++si) si != objectSources.end(); ++si)
{ {
@ -1050,7 +1050,7 @@ void cmVisualStudio10TargetGenerator::WriteAllSources()
} }
} }
std::vector<cmSourceFile*> externalObjects; std::vector<cmSourceFile const*> externalObjects;
this->GeneratorTarget->GetExternalObjects(externalObjects); this->GeneratorTarget->GetExternalObjects(externalObjects);
if(this->LocalGenerator->GetVersion() > cmLocalVisualStudioGenerator::VS10) if(this->LocalGenerator->GetVersion() > cmLocalVisualStudioGenerator::VS10)
{ {
@ -1062,7 +1062,7 @@ void cmVisualStudio10TargetGenerator::WriteAllSources()
{ {
// If an object file is generated in this target, then vs10 will use // If an object file is generated in this target, then vs10 will use
// it in the build, and we have to list it as None instead of Object. // it in the build, and we have to list it as None instead of Object.
for(std::vector<cmSourceFile*>::const_iterator for(std::vector<cmSourceFile const*>::const_iterator
si = externalObjects.begin(); si = externalObjects.begin();
si != externalObjects.end(); ++si) si != externalObjects.end(); ++si)
{ {
@ -1072,7 +1072,7 @@ void cmVisualStudio10TargetGenerator::WriteAllSources()
} }
} }
std::vector<cmSourceFile*> extraSources; std::vector<cmSourceFile const*> extraSources;
this->GeneratorTarget->GetExtraSources(extraSources); this->GeneratorTarget->GetExtraSources(extraSources);
this->WriteSources("None", extraSources); this->WriteSources("None", extraSources);

View File

@ -57,7 +57,8 @@ private:
void WriteProjectConfigurationValues(); void WriteProjectConfigurationValues();
void WriteSource(const char* tool, cmSourceFile const* sf, void WriteSource(const char* tool, cmSourceFile const* sf,
const char* end = 0); const char* end = 0);
void WriteSources(const char* tool, std::vector<cmSourceFile*> const&); void WriteSources(const char* tool,
std::vector<cmSourceFile const*> const&);
void WriteAllSources(); void WriteAllSources();
void WriteDotNetReferences(); void WriteDotNetReferences();
void WriteEmbeddedResourceGroup(); void WriteEmbeddedResourceGroup();