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/cmMakefileLibraryTargetGenerator.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/cmMakefileLibraryTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileLibraryTargetGenerator.cxx | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index b4174cc..38aa59d 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -101,6 +101,9 @@ void cmMakefileLibraryTargetGenerator::WriteRuleFiles() this->WriteModuleLibraryRules(true); } break; + case cmTarget::OBJECT_LIBRARY: + this->WriteObjectLibraryRules(); + break; default: // If language is not known, this is an error. cmSystemTools::Error("Unknown Library Type"); @@ -122,6 +125,29 @@ void cmMakefileLibraryTargetGenerator::WriteRuleFiles() } //---------------------------------------------------------------------------- +void cmMakefileLibraryTargetGenerator::WriteObjectLibraryRules() +{ + std::vector<std::string> commands; + std::vector<std::string> depends; + + // Add post-build rules. + this->LocalGenerator-> + AppendCustomCommands(commands, this->Target->GetPostBuildCommands(), + this->Target); + + // Depend on the object files. + this->AppendObjectDepends(depends); + + // Write the rule. + this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0, + this->Target->GetName(), + depends, commands, true); + + // Write the main driver rule to build everything in this target. + this->WriteTargetDriverRule(this->Target->GetName(), false); +} + +//---------------------------------------------------------------------------- void cmMakefileLibraryTargetGenerator::WriteStaticLibraryRules() { const char* linkLanguage = |