mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-04 13:19:51 -05:00
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.
This commit is contained in:
@@ -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");
|
||||
@@ -121,6 +124,29 @@ void cmMakefileLibraryTargetGenerator::WriteRuleFiles()
|
||||
this->CloseFileStreams();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user