summaryrefslogtreecommitdiff
path: root/Source/cmVisualStudio10TargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2012-03-07 11:56:21 -0500
committerBrad King <brad.king@kitware.com>2012-03-09 15:16:02 -0500
commit62a841b80b5f4b4f9cc0ddba77ae010a29b0e27e (patch)
treeff76a253a8bc9052a3a68d2e9df3fc4be61fb0d0 /Source/cmVisualStudio10TargetGenerator.cxx
parent45c2f93240eb0556b3a8025e154a3dea5e206c7a (diff)
downloadcmake-62a841b80b5f4b4f9cc0ddba77ae010a29b0e27e.tar.gz
Simplify cmVisualStudio10TargetGenerator using cmGeneratorTarget
Use CustomCommands and ModuleDefinitionFile computed in the latter instead of recomputing them from the original target source files.
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx37
1 files changed, 10 insertions, 27 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 66f9a36ace..91688187a3 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -11,6 +11,7 @@
============================================================================*/
#include "cmVisualStudio10TargetGenerator.h"
#include "cmGlobalVisualStudio10Generator.h"
+#include "cmGeneratorTarget.h"
#include "cmTarget.h"
#include "cmComputeLinkInformation.h"
#include "cmGeneratedFileStream.h"
@@ -62,6 +63,7 @@ cmVisualStudio10TargetGenerator(cmTarget* target,
{
this->GlobalGenerator = gg;
this->Target = target;
+ this->GeneratorTarget = gg->GetGeneratorTarget(target);
this->Makefile = target->GetMakefile();
this->LocalGenerator =
(cmLocalVisualStudio7Generator*)
@@ -70,7 +72,8 @@ cmVisualStudio10TargetGenerator(cmTarget* target,
this->GlobalGenerator->CreateGUID(this->Name.c_str());
this->GUID = this->GlobalGenerator->GetGUID(this->Name.c_str());
this->Platform = gg->GetPlatformName();
- this->ComputeObjectNames();
+ this->LocalGenerator
+ ->ComputeObjectNameRequirements(target->GetSourceFiles());
this->BuildFileStream = 0;
}
@@ -421,12 +424,11 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues()
void cmVisualStudio10TargetGenerator::WriteCustomCommands()
{
this->SourcesVisited.clear();
- std::vector<cmSourceFile*> const& sources = this->Target->GetSourceFiles();
- for(std::vector<cmSourceFile*>::const_iterator source = sources.begin();
- source != sources.end(); ++source)
+ for(std::vector<cmSourceFile*>::const_iterator
+ si = this->GeneratorTarget->CustomCommands.begin();
+ si != this->GeneratorTarget->CustomCommands.end(); ++si)
{
- cmSourceFile* sf = *source;
- this->WriteCustomCommand(sf);
+ this->WriteCustomCommand(*si);
}
}
@@ -875,25 +877,6 @@ void cmVisualStudio10TargetGenerator::WriteCLSources()
this->WriteString("</ItemGroup>\n", 1);
}
-void cmVisualStudio10TargetGenerator::ComputeObjectNames()
-{
- // get the classes from the source lists then add them to the groups
- std::vector<cmSourceFile*>const & classes = this->Target->GetSourceFiles();
- for(std::vector<cmSourceFile*>::const_iterator i = classes.begin();
- i != classes.end(); i++)
- {
- // Add the file to the list of sources.
- std::string source = (*i)->GetFullPath();
- if(cmSystemTools::UpperCase((*i)->GetExtension()) == "DEF")
- {
- this->ModuleDefinitionFile = (*i)->GetFullPath();
- }
- }
-
- // Compute which sources need unique object computation.
- this->LocalGenerator->ComputeObjectNameRequirements(classes);
-}
-
bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
cmSourceFile* source)
{
@@ -1513,10 +1496,10 @@ void cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const&
linkOptions.AddFlag("ImportLibrary", imLib.c_str());
linkOptions.AddFlag("ProgramDataBaseFile", pdb.c_str());
linkOptions.Parse(flags.c_str());
- if(!this->ModuleDefinitionFile.empty())
+ if(!this->GeneratorTarget->ModuleDefinitionFile.empty())
{
linkOptions.AddFlag("ModuleDefinitionFile",
- this->ModuleDefinitionFile.c_str());
+ this->GeneratorTarget->ModuleDefinitionFile.c_str());
}
linkOptions.RemoveFlag("GenerateManifest");