Skip to content

Commit 0334712

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 9302bff commit 0334712

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
@@ -115,9 +115,13 @@ endif()
115115

116116
set_property(GLOBAL APPEND PROPERTY XCTest_EXPORTS XCTest)
117117
get_swift_host_arch(swift_arch)
118+
set(SWIFT_INSTALL_SUBDIR "$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>")
119+
if(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin|Windows")
120+
set(SWIFT_INSTALL_SUBDIR "${SWIFT_INSTALL_SUBDIR}/${swift_arch}")
121+
endif()
118122
install(TARGETS XCTest
119-
ARCHIVE DESTINATION lib/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>/$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>
120-
LIBRARY DESTINATION lib/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>/$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>
123+
ARCHIVE DESTINATION lib/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>/${SWIFT_INSTALL_SUBDIR}
124+
LIBRARY DESTINATION lib/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>/${SWIFT_INSTALL_SUBDIR}
121125
RUNTIME DESTINATION bin)
122126
install(FILES
123127
${CMAKE_CURRENT_BINARY_DIR}/swift/XCTest.swiftdoc

0 commit comments

Comments
 (0)