Allow platform files to set large archive rules (#11674)

Commit aaa88d33 (Build large archives incrementally, 2008-08-04)
hard-coded rules to create static archives incrementally in each
language information file.  Set each rule conditionally to allow
compiler and platform information files to override the language
default rules.

Inspired-by: Harald Pohl <pohl.h@eppendorf.de>
This commit is contained in:
Brad King 2011-01-10 09:58:55 -05:00
parent a300edab41
commit c2d73c938a
3 changed files with 27 additions and 9 deletions

View File

@ -164,9 +164,15 @@ ENDIF(NOT CMAKE_C_CREATE_SHARED_MODULE)
# Create a static archive incrementally for large object file counts. # Create a static archive incrementally for large object file counts.
# If CMAKE_C_CREATE_STATIC_LIBRARY is set it will override these. # If CMAKE_C_CREATE_STATIC_LIBRARY is set it will override these.
SET(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>") IF(NOT DEFINED CMAKE_C_ARCHIVE_CREATE)
SET(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>") SET(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
SET(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>") ENDIF()
IF(NOT DEFINED CMAKE_C_ARCHIVE_APPEND)
SET(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>")
ENDIF()
IF(NOT DEFINED CMAKE_C_ARCHIVE_FINISH)
SET(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
ENDIF()
# compile a C file into an object file # compile a C file into an object file
IF(NOT CMAKE_C_COMPILE_OBJECT) IF(NOT CMAKE_C_COMPILE_OBJECT)

View File

@ -241,9 +241,15 @@ ENDIF(NOT CMAKE_CXX_CREATE_SHARED_MODULE)
# Create a static archive incrementally for large object file counts. # Create a static archive incrementally for large object file counts.
# If CMAKE_CXX_CREATE_STATIC_LIBRARY is set it will override these. # If CMAKE_CXX_CREATE_STATIC_LIBRARY is set it will override these.
SET(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>") IF(NOT DEFINED CMAKE_CXX_ARCHIVE_CREATE)
SET(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>") SET(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
SET(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>") ENDIF()
IF(NOT DEFINED CMAKE_CXX_ARCHIVE_APPEND)
SET(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>")
ENDIF()
IF(NOT DEFINED CMAKE_CXX_ARCHIVE_FINISH)
SET(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
ENDIF()
# compile a C++ file into an object file # compile a C++ file into an object file
IF(NOT CMAKE_CXX_COMPILE_OBJECT) IF(NOT CMAKE_CXX_COMPILE_OBJECT)

View File

@ -163,9 +163,15 @@ ENDIF(NOT CMAKE_Fortran_CREATE_SHARED_MODULE)
# Create a static archive incrementally for large object file counts. # Create a static archive incrementally for large object file counts.
# If CMAKE_Fortran_CREATE_STATIC_LIBRARY is set it will override these. # If CMAKE_Fortran_CREATE_STATIC_LIBRARY is set it will override these.
SET(CMAKE_Fortran_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>") IF(NOT DEFINED CMAKE_Fortran_ARCHIVE_CREATE)
SET(CMAKE_Fortran_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>") SET(CMAKE_Fortran_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
SET(CMAKE_Fortran_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>") ENDIF()
IF(NOT DEFINED CMAKE_Fortran_ARCHIVE_APPEND)
SET(CMAKE_Fortran_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>")
ENDIF()
IF(NOT DEFINED CMAKE_Fortran_ARCHIVE_FINISH)
SET(CMAKE_Fortran_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
ENDIF()
# compile a Fortran file into an object file # compile a Fortran file into an object file
IF(NOT CMAKE_Fortran_COMPILE_OBJECT) IF(NOT CMAKE_Fortran_COMPILE_OBJECT)