forked from OSchip/llvm-project
[cmake] Enable users to specify archive creation commands
This diff enables users to override CMAKE_C_ARCHIVE_CREATE & CMAKE_CXX_ARCHIVE_CREATE (currently set in HandleLLVMOptions.cmake). For example, one can specify cmake -DCMAKE_C_ARCHIVE_CREATE="<CMAKE_AR> TDqc <TARGET> <LINK_FLAGS> <OBJECTS>" \ -DCMAKE_CXX_ARCHIVE_CREATE="<CMAKE_AR> TDqc <TARGET> <LINK_FLAGS> <OBJECTS>" ... to make the build create thin archives instead of regular ones. For a clean run `ninja lld` using thin archives seems to reduce the size of the build directory from ~14GB to ~8GB Differential revision: https://reviews.llvm.org/D116850
This commit is contained in:
parent
0ba4e4b500
commit
2d3ae6f484
|
@ -189,11 +189,13 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|||
ERROR_QUIET
|
||||
)
|
||||
if(${RANLIB_RESULT} EQUAL 0)
|
||||
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> Dqc <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> Dqc <TARGET> <LINK_FLAGS> <OBJECTS>"
|
||||
CACHE STRING "archive create command")
|
||||
set(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> Dq <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -D <TARGET>")
|
||||
|
||||
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> Dqc <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> Dqc <TARGET> <LINK_FLAGS> <OBJECTS>"
|
||||
CACHE STRING "archive create command")
|
||||
set(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> Dq <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> -D <TARGET>")
|
||||
endif()
|
||||
|
|
Loading…
Reference in New Issue