summaryrefslogtreecommitdiff
path: root/Modules/CMakeCInformation.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-08-04 11:37:19 -0400
committerBrad King <brad.king@kitware.com>2008-08-04 11:37:19 -0400
commitaaa88d33a96c3006e7a862b9d60eaaac774890cd (patch)
tree3de0321a448c764eedb4a01ed1f87a0b5dcfeffd /Modules/CMakeCInformation.cmake
parent0c20967a6bda705ee5779483047b6ff3c3d58730 (diff)
downloadcmake-aaa88d33a96c3006e7a862b9d60eaaac774890cd.tar.gz
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/CMakeCInformation.cmake')
-rw-r--r--Modules/CMakeCInformation.cmake12
1 files changed, 5 insertions, 7 deletions
diff --git a/Modules/CMakeCInformation.cmake b/Modules/CMakeCInformation.cmake
index e3a8d93435..a2ad460f9a 100644
--- a/Modules/CMakeCInformation.cmake
+++ b/Modules/CMakeCInformation.cmake
@@ -98,7 +98,6 @@ INCLUDE(CMakeCommonLanguageInclude)
# CMAKE_C_CREATE_SHARED_LIBRARY
# CMAKE_C_CREATE_SHARED_MODULE
-# CMAKE_C_CREATE_STATIC_LIBRARY
# CMAKE_C_COMPILE_OBJECT
# CMAKE_C_LINK_EXECUTABLE
@@ -133,12 +132,11 @@ IF(NOT CMAKE_C_CREATE_SHARED_MODULE)
SET(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_C_CREATE_SHARED_LIBRARY})
ENDIF(NOT CMAKE_C_CREATE_SHARED_MODULE)
-# create a C static library
-IF(NOT CMAKE_C_CREATE_STATIC_LIBRARY)
- SET(CMAKE_C_CREATE_STATIC_LIBRARY
- "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS> "
- "<CMAKE_RANLIB> <TARGET> ")
-ENDIF(NOT CMAKE_C_CREATE_STATIC_LIBRARY)
+# Create a static archive incrementally for large object file counts.
+# If CMAKE_C_CREATE_STATIC_LIBRARY is set it will override these.
+SET(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
+SET(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>")
+SET(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
# compile a C file into an object file
IF(NOT CMAKE_C_COMPILE_OBJECT)