forked from OSchip/llvm-project
[CMake] Move the AIX archiver settings to a module
This allows their reuse across projects. The name of the module is intentionally generic because we would like to move more platform checks there. Differential Revision: https://reviews.llvm.org/D115276
This commit is contained in:
parent
fffd663c87
commit
96e36048fd
|
@ -0,0 +1,9 @@
|
|||
get_property(languages GLOBAL PROPERTY ENABLED_LANGUAGES)
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "AIX")
|
||||
foreach(lang IN LISTS languages)
|
||||
set(CMAKE_${lang}_ARCHIVE_CREATE "<CMAKE_AR> -X32_64 qc <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_${lang}_ARCHIVE_APPEND "<CMAKE_AR> -X32_64 q <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_${lang}_ARCHIVE_FINISH "<CMAKE_RANLIB> -X32_64 <TARGET>")
|
||||
endforeach()
|
||||
endif()
|
|
@ -28,6 +28,7 @@ else()
|
|||
set(CMAKE_CFG_RESOLVED_INTDIR "")
|
||||
endif()
|
||||
|
||||
include(SetPlatformToolchainTools)
|
||||
include(base-config-ix)
|
||||
include(CompilerRTUtils)
|
||||
|
||||
|
@ -574,15 +575,6 @@ if (CMAKE_LINKER MATCHES "link.exe$")
|
|||
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /IGNORE:4221")
|
||||
endif()
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "AIX")
|
||||
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> -X32_64 qc <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> -X32_64 qc <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> -X32_64 q <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> -X32_64 q <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -X32_64 <TARGET>")
|
||||
set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> -X32_64 <TARGET>")
|
||||
endif()
|
||||
|
||||
add_subdirectory(include)
|
||||
|
||||
option(COMPILER_RT_USE_LIBCXX
|
||||
|
|
|
@ -28,6 +28,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
|||
load_llvm_config()
|
||||
construct_compiler_rt_default_triple()
|
||||
|
||||
include(SetPlatformToolchainTools)
|
||||
if(APPLE)
|
||||
include(CompilerRTDarwinUtils)
|
||||
endif()
|
||||
|
@ -35,15 +36,6 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
|||
include(UseLibtool)
|
||||
endif()
|
||||
include(AddCompilerRT)
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "AIX")
|
||||
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> -X32_64 qc <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> -X32_64 qc <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> -X32_64 q <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> -X32_64 q <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -X32_64 <TARGET>")
|
||||
set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> -X32_64 <TARGET>")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (COMPILER_RT_STANDALONE_BUILD)
|
||||
|
|
Loading…
Reference in New Issue