diff options
author | Brad King <brad.king@kitware.com> | 2018-05-17 13:06:51 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-05-17 13:06:56 (GMT) |
commit | b6ce5aef0fd3b9d0c60643073db1880b857189b8 (patch) | |
tree | 981eba3780d4d34b056d88137ec8bcea857a28e3 | |
parent | 4ba7db4ff36a20512b0bd9e725b7dea5246e7554 (diff) | |
parent | b6c49713b35cf1ab9c0bff30cb7a6e20a8f3b481 (diff) | |
download | CMake-b6ce5aef0fd3b9d0c60643073db1880b857189b8.zip CMake-b6ce5aef0fd3b9d0c60643073db1880b857189b8.tar.gz CMake-b6ce5aef0fd3b9d0c60643073db1880b857189b8.tar.bz2 |
Merge topic 'makefile-ar-limits'
b6c49713b3 Makefile: Fix command line limits for static libs
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2078
-rw-r--r-- | Source/cmMakefileLibraryTargetGenerator.cxx | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index 27fae04..c538992 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -5,6 +5,7 @@ #include <algorithm> #include <memory> // IWYU pragma: keep #include <sstream> +#include <stddef.h> #include <vector> #include "cmGeneratedFileStream.h" @@ -732,10 +733,14 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( // Archiving rules never use a response file. useResponseFileForObjects = false; - // Limit the length of individual object lists to less than the - // 32K command line length limit on Windows. We could make this a - // platform file variable but this should work everywhere. - archiveCommandLimit = 30000; + // Limit the length of individual object lists to less than half of + // the command line length limit (leaving half for other flags). + // This may result in several calls to the archiver. + if (size_t limit = cmSystemTools::CalculateCommandLineLengthLimit()) { + archiveCommandLimit = limit / 2; + } else { + archiveCommandLimit = 8000; + } } // Expand the rule variables. |