summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx71
1 files changed, 52 insertions, 19 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 8688f78..01fad26 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -289,7 +289,7 @@ static void handleSystemIncludesDep(cmMakefile *mf, cmTarget* depTgt,
#define IMPLEMENT_VISIT_IMPL(DATA, DATATYPE) \
{ \
std::vector<cmSourceFile*> sourceFiles; \
- this->Target->GetSourceFiles(sourceFiles); \
+ this->Target->GetSourceFiles(sourceFiles, config); \
TagVisitor<DATA ## Tag DATATYPE> visitor(this->Target, data); \
for(std::vector<cmSourceFile*>::const_iterator si = sourceFiles.begin(); \
si != sourceFiles.end(); ++si) \
@@ -308,7 +308,8 @@ static void handleSystemIncludesDep(cmMakefile *mf, cmTarget* depTgt,
//----------------------------------------------------------------------------
void
cmGeneratorTarget
-::GetObjectSources(std::vector<cmSourceFile const*> &data) const
+::GetObjectSources(std::vector<cmSourceFile const*> &data,
+ const std::string& config) const
{
IMPLEMENT_VISIT(ObjectSources);
@@ -332,8 +333,19 @@ void cmGeneratorTarget::ComputeObjectMapping()
{
return;
}
- std::vector<cmSourceFile const*> sourceFiles;
- this->GetObjectSources(sourceFiles);
+
+ std::vector<std::string> configs;
+ this->Makefile->GetConfigurations(configs);
+ if (configs.empty())
+ {
+ configs.push_back("");
+ }
+ for(std::vector<std::string>::const_iterator ci = configs.begin();
+ ci != configs.end(); ++ci)
+ {
+ std::vector<cmSourceFile const*> sourceFiles;
+ this->GetObjectSources(sourceFiles, *ci);
+ }
}
//----------------------------------------------------------------------------
@@ -360,7 +372,8 @@ bool cmGeneratorTarget::HasExplicitObjectName(cmSourceFile const* file) const
//----------------------------------------------------------------------------
void cmGeneratorTarget
-::GetIDLSources(std::vector<cmSourceFile const*>& data) const
+::GetIDLSources(std::vector<cmSourceFile const*>& data,
+ const std::string& config) const
{
IMPLEMENT_VISIT(IDLSources);
}
@@ -368,14 +381,16 @@ void cmGeneratorTarget
//----------------------------------------------------------------------------
void
cmGeneratorTarget
-::GetHeaderSources(std::vector<cmSourceFile const*>& data) const
+::GetHeaderSources(std::vector<cmSourceFile const*>& data,
+ const std::string& config) const
{
IMPLEMENT_VISIT(HeaderSources);
}
//----------------------------------------------------------------------------
void cmGeneratorTarget
-::GetExtraSources(std::vector<cmSourceFile const*>& data) const
+::GetExtraSources(std::vector<cmSourceFile const*>& data,
+ const std::string& config) const
{
IMPLEMENT_VISIT(ExtraSources);
}
@@ -383,7 +398,8 @@ void cmGeneratorTarget
//----------------------------------------------------------------------------
void
cmGeneratorTarget
-::GetCustomCommands(std::vector<cmSourceFile const*>& data) const
+::GetCustomCommands(std::vector<cmSourceFile const*>& data,
+ const std::string& config) const
{
IMPLEMENT_VISIT(CustomCommands);
}
@@ -391,14 +407,16 @@ cmGeneratorTarget
//----------------------------------------------------------------------------
void
cmGeneratorTarget
-::GetExternalObjects(std::vector<cmSourceFile const*>& data) const
+::GetExternalObjects(std::vector<cmSourceFile const*>& data,
+ const std::string& config) const
{
IMPLEMENT_VISIT(ExternalObjects);
}
//----------------------------------------------------------------------------
void
-cmGeneratorTarget::GetExpectedResxHeaders(std::set<std::string>& srcs) const
+cmGeneratorTarget::GetExpectedResxHeaders(std::set<std::string>& srcs,
+ const std::string& config) const
{
ResxData data;
IMPLEMENT_VISIT_IMPL(Resx, COMMA cmGeneratorTarget::ResxData)
@@ -407,7 +425,8 @@ cmGeneratorTarget::GetExpectedResxHeaders(std::set<std::string>& srcs) const
//----------------------------------------------------------------------------
void cmGeneratorTarget
-::GetResxSources(std::vector<cmSourceFile const*>& srcs) const
+::GetResxSources(std::vector<cmSourceFile const*>& srcs,
+ const std::string& config) const
{
ResxData data;
IMPLEMENT_VISIT_IMPL(Resx, COMMA cmGeneratorTarget::ResxData)
@@ -517,13 +536,15 @@ bool cmGeneratorTarget::GetPropertyAsBool(const std::string& prop) const
}
//----------------------------------------------------------------------------
-void cmGeneratorTarget::GetSourceFiles(std::vector<cmSourceFile*> &files) const
+void cmGeneratorTarget::GetSourceFiles(std::vector<cmSourceFile*> &files,
+ const std::string& config) const
{
- this->Target->GetSourceFiles(files);
+ this->Target->GetSourceFiles(files, config);
}
//----------------------------------------------------------------------------
-std::string cmGeneratorTarget::GetModuleDefinitionFile() const
+std::string
+cmGeneratorTarget::GetModuleDefinitionFile(const std::string& config) const
{
std::string data;
IMPLEMENT_VISIT_IMPL(ModuleDefinitionFile, COMMA std::string)
@@ -532,10 +553,11 @@ std::string cmGeneratorTarget::GetModuleDefinitionFile() const
//----------------------------------------------------------------------------
void
-cmGeneratorTarget::UseObjectLibraries(std::vector<std::string>& objs) const
+cmGeneratorTarget::UseObjectLibraries(std::vector<std::string>& objs,
+ const std::string &config) const
{
std::vector<cmSourceFile const*> objectFiles;
- this->GetExternalObjects(objectFiles);
+ this->GetExternalObjects(objectFiles, config);
std::vector<cmTarget*> objectLibraries;
std::set<cmTarget*> emitted;
for(std::vector<cmSourceFile const*>::const_iterator
@@ -559,7 +581,7 @@ cmGeneratorTarget::UseObjectLibraries(std::vector<std::string>& objs) const
cmGeneratorTarget* ogt =
this->GlobalGenerator->GetGeneratorTarget(objLib);
std::vector<cmSourceFile const*> objectSources;
- ogt->GetObjectSources(objectSources);
+ ogt->GetObjectSources(objectSources, config);
for(std::vector<cmSourceFile const*>::const_iterator
si = objectSources.begin();
si != objectSources.end(); ++si)
@@ -615,11 +637,22 @@ cmTargetTraceDependencies
if (this->Target->GetType() != cmTarget::INTERFACE_LIBRARY)
{
std::vector<std::string> sources;
- this->Target->GetSourceFiles(sources);
+ std::vector<std::string> configs;
+ this->Makefile->GetConfigurations(configs);
+ if (configs.empty())
+ {
+ configs.push_back("");
+ }
+ for(std::vector<std::string>::const_iterator ci = configs.begin();
+ ci != configs.end(); ++ci)
+ {
+ this->Target->GetSourceFiles(sources, *ci);
+ }
+ std::set<std::string> emitted;
for(std::vector<std::string>::const_iterator si = sources.begin();
si != sources.end(); ++si)
{
- if(this->SourcesQueued.insert(*si).second)
+ if(emitted.insert(*si).second && this->SourcesQueued.insert(*si).second)
{
this->SourceQueue.push(*si);
this->Makefile->GetOrCreateSource(*si);