diff options
author | Brad King <brad.king@kitware.com> | 2012-03-12 14:54:37 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-03-13 18:38:02 (GMT) |
commit | 3aa741acb6b47d83a0892ddf027ddb0abdc33e78 (patch) | |
tree | d3416968375e99e3e99dce6611440535085b0cb7 /Source/cmMakefileTargetGenerator.cxx | |
parent | b87d7a60a0ed146b79c49baedb666db228d5a70f (diff) | |
download | CMake-3aa741acb6b47d83a0892ddf027ddb0abdc33e78.zip CMake-3aa741acb6b47d83a0892ddf027ddb0abdc33e78.tar.gz CMake-3aa741acb6b47d83a0892ddf027ddb0abdc33e78.tar.bz2 |
Build object library targets in Makefiles
Treat OBJECT libraries as STATIC libraries but leave out the archive
step. The object files will be left behind for reference by other
targets later.
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index fc55f1e..d0cfd99 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -65,6 +65,7 @@ cmMakefileTargetGenerator::New(cmTarget *tgt) case cmTarget::STATIC_LIBRARY: case cmTarget::SHARED_LIBRARY: case cmTarget::MODULE_LIBRARY: + case cmTarget::OBJECT_LIBRARY: result = new cmMakefileLibraryTargetGenerator(tgt); break; case cmTarget::UTILITY: @@ -1596,7 +1597,7 @@ void cmMakefileTargetGenerator //---------------------------------------------------------------------------- void cmMakefileTargetGenerator -::AppendLinkDepends(std::vector<std::string>& depends) +::AppendObjectDepends(std::vector<std::string>& depends) { // Add dependencies on the compiled object files. std::string relPath = this->LocalGenerator->GetHomeRelativeOutputPath(); @@ -1609,12 +1610,27 @@ void cmMakefileTargetGenerator depends.push_back(objTarget); } - // Add dependencies on targets that must be built first. - this->AppendTargetDepends(depends); + // 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); + } // Add a dependency on the rule file itself. this->LocalGenerator->AppendRuleDepend(depends, this->BuildFileNameFull.c_str()); +} + +//---------------------------------------------------------------------------- +void cmMakefileTargetGenerator +::AppendLinkDepends(std::vector<std::string>& depends) +{ + this->AppendObjectDepends(depends); + + // Add dependencies on targets that must be built first. + this->AppendTargetDepends(depends); // Add a dependency on the link definitions file, if any. if(!this->GeneratorTarget->ModuleDefinitionFile.empty()) @@ -1622,14 +1638,6 @@ void cmMakefileTargetGenerator depends.push_back(this->GeneratorTarget->ModuleDefinitionFile); } - // 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); - } - // Add user-specified dependencies. if(const char* linkDepends = this->Target->GetProperty("LINK_DEPENDS")) |