Skip to content

Commit 28ee90f

Browse files
committed
install: place the library 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 fae20a5 commit 28ee90f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,13 @@ endif()
116116

117117
set_property(GLOBAL APPEND PROPERTY XCTest_EXPORTS XCTest)
118118
get_swift_host_arch(swift_arch)
119+
set(SWIFT_INSTALL_SUBDIR "$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>")
120+
if(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin|Windows")
121+
set(SWIFT_INSTALL_SUBDIR "${SWIFT_INSTALL_SUBDIR}/${swift_arch}")
122+
endif()
119123
install(TARGETS XCTest
120-
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>/$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>
121-
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>/$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>
124+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>/${SWIFT_INSTALL_SUBDIR}
125+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>/${SWIFT_INSTALL_SUBDIR}
122126
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
123127
install(FILES
124128
${CMAKE_CURRENT_BINARY_DIR}/swift/XCTest.swiftdoc

0 commit comments

Comments
 (0)