Skip to content

Commit 5018e0a

Browse files
committed
install: place the libraries in architecture-specific directories on ELF platforms
This is needed for swiftlang/swift#63782, which changes the Unix toolchain to look for libraries in architecture-specific directories.
1 parent 6242e80 commit 5018e0a

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

src/BlocksRuntime/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ if(INSTALL_PRIVATE_HEADERS)
3131
DESTINATION ${INSTALL_BLOCK_HEADERS_DIR})
3232
endif()
3333
set_property(GLOBAL APPEND PROPERTY DISPATCH_EXPORTS BlocksRuntime)
34+
if(ENABLE_SWIFT AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin|Windows")
35+
get_swift_host_arch(swift_arch)
36+
set(INSTALL_TARGET_DIR "${INSTALL_TARGET_DIR}/${swift_arch}")
37+
endif()
3438
install(TARGETS BlocksRuntime
3539
EXPORT dispatchExports
3640
ARCHIVE DESTINATION ${INSTALL_TARGET_DIR}

src/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ if(ENABLE_SWIFT)
163163
add_subdirectory(swift)
164164
endif()
165165

166+
if(ENABLE_SWIFT AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin|Windows")
167+
get_swift_host_arch(swift_arch)
168+
set(INSTALL_TARGET_DIR "${INSTALL_TARGET_DIR}/${swift_arch}")
169+
endif()
166170
set_property(GLOBAL APPEND PROPERTY DISPATCH_EXPORTS dispatch)
167171
install(TARGETS dispatch
168172
EXPORT dispatchExports

src/swift/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ install(FILES
5050
${CMAKE_CURRENT_BINARY_DIR}/swift/Dispatch.swiftdoc
5151
DESTINATION ${INSTALL_TARGET_DIR}/${swift_arch})
5252
set_property(GLOBAL APPEND PROPERTY DISPATCH_EXPORTS swiftDispatch)
53+
if(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin|Windows")
54+
set(INSTALL_TARGET_DIR "${INSTALL_TARGET_DIR}/${swift_arch}")
55+
endif()
5356
install(TARGETS swiftDispatch
5457
EXPORT dispatchExports
5558
ARCHIVE DESTINATION ${INSTALL_TARGET_DIR}

0 commit comments

Comments
 (0)