mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-24 15:18:26 -05:00
ENH: Build large archives incrementally
Creation of archive libraries with the unix 'ar' tool should be done incrementally when the number of object files is large. This avoids problems with the command line getting too many arguments.
This commit is contained in:
@@ -612,12 +612,15 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
|
||||
}
|
||||
|
||||
// For static libraries there might be archiving rules.
|
||||
bool haveStaticLibraryRule = false;
|
||||
std::vector<std::string> archiveCreateCommands;
|
||||
std::vector<std::string> archiveAppendCommands;
|
||||
std::vector<std::string> archiveFinishCommands;
|
||||
std::string::size_type archiveCommandLimit = std::string::npos;
|
||||
if(this->Target->GetType() == cmTarget::STATIC_LIBRARY)
|
||||
{
|
||||
haveStaticLibraryRule =
|
||||
this->Makefile->GetDefinition(linkRuleVar)? true:false;
|
||||
std::string arCreateVar = "CMAKE_";
|
||||
arCreateVar += linkLanguage;
|
||||
arCreateVar += "_ARCHIVE_CREATE";
|
||||
@@ -643,6 +646,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
|
||||
|
||||
// Decide whether to use archiving rules.
|
||||
bool useArchiveRules =
|
||||
!haveStaticLibraryRule &&
|
||||
!archiveCreateCommands.empty() && !archiveAppendCommands.empty();
|
||||
if(useArchiveRules)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user