summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaTargetGenerator.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-02-13 16:25:00 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-04-02 21:14:02 (GMT)
commite6971df6ab647031ba9689c9afbbde78cc62e35f (patch)
treec9c67c6e3a1627d65cda8ee93373b97403c92106 /Source/cmNinjaTargetGenerator.cxx
parentdf753df94bb1e995372baabb0240585560c72ded (diff)
downloadCMake-e6971df6ab647031ba9689c9afbbde78cc62e35f.zip
CMake-e6971df6ab647031ba9689c9afbbde78cc62e35f.tar.gz
CMake-e6971df6ab647031ba9689c9afbbde78cc62e35f.tar.bz2
cmTarget: Make the source files depend on the config.
Disallow the use of config-specific source files with the Visual Studio and Xcode generators. They don't have any way to represent the condition currently. Use the same common-config API in cmQtAutoGenerators. While it accepts config-specific files, it doesn't have to support multiple configurations yet. Loop over the configs in cmTargetTraceDependencies and cmGlobalGenerator::WriteSummary and consume all source files. Loop over the configs in cmComputeTargetDepends and compute the object library dependencies for each config.
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaTargetGenerator.cxx16
1 files changed, 9 insertions, 7 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index b7eab7d..56155ef 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -485,8 +485,9 @@ cmNinjaTargetGenerator
<< this->GetTargetName()
<< "\n\n";
+ std::string config = this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
std::vector<cmSourceFile const*> customCommands;
- this->GeneratorTarget->GetCustomCommands(customCommands);
+ this->GeneratorTarget->GetCustomCommands(customCommands, config);
for(std::vector<cmSourceFile const*>::const_iterator
si = customCommands.begin();
si != customCommands.end(); ++si)
@@ -495,17 +496,17 @@ cmNinjaTargetGenerator
this->GetLocalGenerator()->AddCustomCommandTarget(cc, this->GetTarget());
}
std::vector<cmSourceFile const*> headerSources;
- this->GeneratorTarget->GetHeaderSources(headerSources);
+ this->GeneratorTarget->GetHeaderSources(headerSources, config);
this->OSXBundleGenerator->GenerateMacOSXContentStatements(
headerSources,
this->MacOSXContentGenerator);
std::vector<cmSourceFile const*> extraSources;
- this->GeneratorTarget->GetExtraSources(extraSources);
+ this->GeneratorTarget->GetExtraSources(extraSources, config);
this->OSXBundleGenerator->GenerateMacOSXContentStatements(
extraSources,
this->MacOSXContentGenerator);
std::vector<cmSourceFile const*> externalObjects;
- this->GeneratorTarget->GetExternalObjects(externalObjects);
+ this->GeneratorTarget->GetExternalObjects(externalObjects, config);
for(std::vector<cmSourceFile const*>::const_iterator
si = externalObjects.begin();
si != externalObjects.end(); ++si)
@@ -513,13 +514,13 @@ cmNinjaTargetGenerator
this->Objects.push_back(this->GetSourceFilePath(*si));
}
std::vector<cmSourceFile const*> objectSources;
- this->GeneratorTarget->GetObjectSources(objectSources);
+ this->GeneratorTarget->GetObjectSources(objectSources, config);
for(std::vector<cmSourceFile const*>::const_iterator
si = objectSources.begin(); si != objectSources.end(); ++si)
{
this->WriteObjectBuildStatement(*si);
}
- std::string def = this->GeneratorTarget->GetModuleDefinitionFile();
+ std::string def = this->GeneratorTarget->GetModuleDefinitionFile(config);
if(!def.empty())
{
this->ModuleDefinitionFile = this->ConvertToNinjaPath(def.c_str());
@@ -565,7 +566,8 @@ cmNinjaTargetGenerator
// Add order-only dependencies on custom command outputs.
std::vector<cmSourceFile const*> customCommands;
- this->GeneratorTarget->GetCustomCommands(customCommands);
+ std::string config = this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
+ this->GeneratorTarget->GetCustomCommands(customCommands, config);
for(std::vector<cmSourceFile const*>::const_iterator
si = customCommands.begin();
si != customCommands.end(); ++si)