diff options
author | Brad King <brad.king@kitware.com> | 2008-08-04 15:37:19 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-08-04 15:37:19 (GMT) |
commit | aaa88d33a96c3006e7a862b9d60eaaac774890cd (patch) | |
tree | 3de0321a448c764eedb4a01ed1f87a0b5dcfeffd /Modules/CMakeCXXInformation.cmake | |
parent | 0c20967a6bda705ee5779483047b6ff3c3d58730 (diff) | |
download | CMake-aaa88d33a96c3006e7a862b9d60eaaac774890cd.zip CMake-aaa88d33a96c3006e7a862b9d60eaaac774890cd.tar.gz CMake-aaa88d33a96c3006e7a862b9d60eaaac774890cd.tar.bz2 |
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.
Diffstat (limited to 'Modules/CMakeCXXInformation.cmake')
-rw-r--r-- | Modules/CMakeCXXInformation.cmake | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Modules/CMakeCXXInformation.cmake b/Modules/CMakeCXXInformation.cmake index 65c5902..c5608e0 100644 --- a/Modules/CMakeCXXInformation.cmake +++ b/Modules/CMakeCXXInformation.cmake @@ -176,7 +176,6 @@ INCLUDE(CMakeCommonLanguageInclude) # now define the following rules: # CMAKE_CXX_CREATE_SHARED_LIBRARY # CMAKE_CXX_CREATE_SHARED_MODULE -# CMAKE_CXX_CREATE_STATIC_LIBRARY # CMAKE_CXX_COMPILE_OBJECT # CMAKE_CXX_LINK_EXECUTABLE @@ -212,12 +211,11 @@ IF(NOT CMAKE_CXX_CREATE_SHARED_MODULE) ENDIF(NOT CMAKE_CXX_CREATE_SHARED_MODULE) -# create a C++ static library -IF(NOT CMAKE_CXX_CREATE_STATIC_LIBRARY) - SET(CMAKE_CXX_CREATE_STATIC_LIBRARY - "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS> " - "<CMAKE_RANLIB> <TARGET> ") -ENDIF(NOT CMAKE_CXX_CREATE_STATIC_LIBRARY) +# Create a static archive incrementally for large object file counts. +# If CMAKE_CXX_CREATE_STATIC_LIBRARY is set it will override these. +SET(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>") +SET(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>") +SET(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>") # compile a C++ file into an object file IF(NOT CMAKE_CXX_COMPILE_OBJECT) |