diff options
author | Brad King <brad.king@kitware.com> | 2010-11-05 12:33:47 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2010-11-05 12:33:47 (GMT) |
commit | 07cfa57ec5f9f906e075512646100719a0a615aa (patch) | |
tree | 020369090ea590192ebf629228dc7bc046892fa6 /Source/cmMakefileTargetGenerator.cxx | |
parent | 947de96030723fa231ed1ddc9d94d755f3d68d0b (diff) | |
download | CMake-07cfa57ec5f9f906e075512646100719a0a615aa.zip CMake-07cfa57ec5f9f906e075512646100719a0a615aa.tar.gz CMake-07cfa57ec5f9f906e075512646100719a0a615aa.tar.bz2 |
Consolidate duplicate link rule make dependency code
Factor code previously duplicated for library and executable rules into
a common method.
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index d5d6585..0c150df 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -1507,6 +1507,37 @@ void cmMakefileTargetGenerator //---------------------------------------------------------------------------- void cmMakefileTargetGenerator +::AppendLinkDepends(std::vector<std::string>& depends) +{ + // Add dependencies on the compiled object files. + std::string relPath = this->LocalGenerator->GetHomeRelativeOutputPath(); + std::string objTarget; + for(std::vector<std::string>::const_iterator obj = this->Objects.begin(); + obj != this->Objects.end(); ++obj) + { + objTarget = relPath; + objTarget += *obj; + depends.push_back(objTarget); + } + + // Add dependencies on targets that must be built first. + this->AppendTargetDepends(depends); + + // Add a dependency on the rule file itself. + this->LocalGenerator->AppendRuleDepend(depends, + this->BuildFileNameFull.c_str()); + + // Add dependencies on the external object files. + for(std::vector<std::string>::const_iterator obj + = this->ExternalObjects.begin(); + obj != this->ExternalObjects.end(); ++obj) + { + depends.push_back(*obj); + } +} + +//---------------------------------------------------------------------------- +void cmMakefileTargetGenerator ::CloseFileStreams() { delete this->BuildFileStream; |