summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2012-03-07 19:01:46 (GMT)
committerBrad King <brad.king@kitware.com>2012-03-09 20:16:02 (GMT)
commit3baaf6ccecb9117b613fc89cd37206960298dfaa (patch)
tree12e5a8e3b6df8faed7a386500768f008f6cf3ce6 /Source/cmMakefileTargetGenerator.cxx
parent62a841b80b5f4b4f9cc0ddba77ae010a29b0e27e (diff)
downloadCMake-3baaf6ccecb9117b613fc89cd37206960298dfaa.zip
CMake-3baaf6ccecb9117b613fc89cd37206960298dfaa.tar.gz
CMake-3baaf6ccecb9117b613fc89cd37206960298dfaa.tar.bz2
Pre-compute object file names before Makefile generation
Add a virtual cmGlobalGenerator::ComputeTargetObjects method invoked during cmGeneratorTarget construction. Implement it in the Makefile generator to pre-compute all object file names for each target. Use the results during generation instead of re-computing it later.
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileTargetGenerator.cxx14
1 files changed, 4 insertions, 10 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index b374bb6..fc55f1e 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -418,12 +418,10 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(cmSourceFile& source)
}
// Get the full path name of the object file.
- bool hasSourceExtension;
- std::string objNoTargetDir;
- std::string obj =
- this->LocalGenerator->GetObjectFileName(*this->Target, source,
- &objNoTargetDir,
- &hasSourceExtension);
+ std::string const& objectName = this->GeneratorTarget->Objects[&source];
+ std::string obj = this->LocalGenerator->GetTargetDirectory(*this->Target);
+ obj += "/";
+ obj += objectName;
// Avoid generating duplicate rules.
if(this->ObjectFiles.find(obj) == this->ObjectFiles.end())
@@ -477,10 +475,6 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(cmSourceFile& source)
AddImplicitDepends(*this->Target, lang,
objFullPath.c_str(),
srcFullPath.c_str());
-
- // add this to the list of objects for this local generator
- this->LocalGenerator->AddLocalObjectFile(
- this->Target, &source, objNoTargetDir, hasSourceExtension);
}
//----------------------------------------------------------------------------