summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalVisualStudio6Generator.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/cmLocalVisualStudio6Generator.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/cmLocalVisualStudio6Generator.cxx')
-rw-r--r--Source/cmLocalVisualStudio6Generator.cxx37
1 files changed, 33 insertions, 4 deletions
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index 11e9679..5db735f 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -317,7 +317,10 @@ void cmLocalVisualStudio6Generator::WriteDSPFile(std::ostream& fout,
// get the classes from the source lists then add them to the groups
std::vector<cmSourceFile*> classes;
- target.GetSourceFiles(classes);
+ if (!target.GetConfigCommonSourceFiles(classes))
+ {
+ return;
+ }
// now all of the source files have been properly assigned to the target
// now stick them into source groups using the reg expressions
@@ -1269,7 +1272,20 @@ void cmLocalVisualStudio6Generator
if(targetBuilds)
{
// Get the language to use for linking.
- const std::string& linkLanguage = target.GetLinkerLanguage();
+ std::vector<std::string> configs;
+ target.GetMakefile()->GetConfigurations(configs);
+ std::vector<std::string>::const_iterator it = configs.begin();
+ const std::string& linkLanguage = target.GetLinkerLanguage(*it);
+ for ( ; it != configs.end(); ++it)
+ {
+ const std::string& configLinkLanguage = target.GetLinkerLanguage(*it);
+ if (configLinkLanguage != linkLanguage)
+ {
+ cmSystemTools::Error
+ ("Linker language must not vary by configuration for target: ",
+ target.GetName().c_str());
+ }
+ }
if(linkLanguage.empty())
{
cmSystemTools::Error
@@ -1691,7 +1707,20 @@ void cmLocalVisualStudio6Generator
if(target.GetType() >= cmTarget::EXECUTABLE &&
target.GetType() <= cmTarget::OBJECT_LIBRARY)
{
- const std::string& linkLanguage = target.GetLinkerLanguage();
+ std::vector<std::string> configs;
+ target.GetMakefile()->GetConfigurations(configs);
+ std::vector<std::string>::const_iterator it = configs.begin();
+ const std::string& linkLanguage = target.GetLinkerLanguage(*it);
+ for ( ; it != configs.end(); ++it)
+ {
+ const std::string& configLinkLanguage = target.GetLinkerLanguage(*it);
+ if (configLinkLanguage != linkLanguage)
+ {
+ cmSystemTools::Error
+ ("Linker language must not vary by configuration for target: ",
+ target.GetName().c_str());
+ }
+ }
if(linkLanguage.empty())
{
cmSystemTools::Error
@@ -1889,7 +1918,7 @@ void cmLocalVisualStudio6Generator
cmGeneratorTarget* gt =
this->GlobalGenerator->GetGeneratorTarget(&target);
std::vector<std::string> objs;
- gt->UseObjectLibraries(objs);
+ gt->UseObjectLibraries(objs, "");
for(std::vector<std::string>::const_iterator
oi = objs.begin(); oi != objs.end(); ++oi)
{