summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-01-08 19:32:17 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-01-08 19:32:17 (GMT)
commit9549ac1df5c1c7c330cb07cde29f424bfcfb4c1a (patch)
tree7a60c2f37de9a61b68168331ef384efe23cbc463 /Source
parentaf770bc27e7870ef2e3796163ff610773cb51a38 (diff)
parentb684b395812872184cbf10e0e0513e2a18546047 (diff)
downloadCMake-9549ac1df5c1c7c330cb07cde29f424bfcfb4c1a.zip
CMake-9549ac1df5c1c7c330cb07cde29f424bfcfb4c1a.tar.gz
CMake-9549ac1df5c1c7c330cb07cde29f424bfcfb4c1a.tar.bz2
Merge topic 'vs11-external-object'
b684b39 VS11: Simplify external object file handling (#13831)
Diffstat (limited to 'Source')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx25
1 files changed, 20 insertions, 5 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index ec9c125..2596d73 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -572,6 +572,12 @@ cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile* source,
sep = ";";
}
(*this->BuildFileStream ) << "</Outputs>\n";
+ if(this->LocalGenerator->GetVersion() > cmLocalVisualStudioGenerator::VS10)
+ {
+ // VS >= 11 let us turn off linking of custom command outputs.
+ this->WritePlatformConfigTag("LinkObjects", i->c_str(), 3);
+ (*this->BuildFileStream ) << "false</LinkObjects>\n";
+ }
}
this->WriteString("</CustomBuild>\n", 2);
}
@@ -879,14 +885,23 @@ void cmVisualStudio10TargetGenerator::WriteAllSources()
}
}
- for(std::vector<cmSourceFile*>::const_iterator
- si = this->GeneratorTarget->ExternalObjects.begin();
- si != this->GeneratorTarget->ExternalObjects.end(); ++si)
+ if(this->LocalGenerator->GetVersion() > cmLocalVisualStudioGenerator::VS10)
+ {
+ // For VS >= 11 we use LinkObjects to avoid linking custom command
+ // outputs. Use Object for all external objects, generated or not.
+ this->WriteSources("Object", this->GeneratorTarget->ExternalObjects);
+ }
+ else
{
// 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.
- std::vector<cmSourceFile*> const* d = this->Target->GetSourceDepends(*si);
- this->WriteSource((d && !d->empty())? "None":"Object", *si);
+ for(std::vector<cmSourceFile*>::const_iterator
+ si = this->GeneratorTarget->ExternalObjects.begin();
+ si != this->GeneratorTarget->ExternalObjects.end(); ++si)
+ {
+ std::vector<cmSourceFile*> const* d=this->Target->GetSourceDepends(*si);
+ this->WriteSource((d && !d->empty())? "None":"Object", *si);
+ }
}
this->WriteSources("None", this->GeneratorTarget->ExtraSources);