From 28ee90fd78cd5ea8f056221022071f97c118c9f5 Mon Sep 17 00:00:00 2001 From: Butta Date: Thu, 23 Feb 2023 14:53:49 +0530 Subject: [PATCH] install: place the library in architecture-specific directories on ELF platforms This is needed for apple/swift#63782, which changes the Unix toolchain to look for libraries in architecture-specific directories. --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e8078e7..73102e20 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -116,9 +116,13 @@ endif() set_property(GLOBAL APPEND PROPERTY XCTest_EXPORTS XCTest) get_swift_host_arch(swift_arch) +set(SWIFT_INSTALL_SUBDIR "$") +if(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin|Windows") + set(SWIFT_INSTALL_SUBDIR "${SWIFT_INSTALL_SUBDIR}/${swift_arch}") +endif() install(TARGETS XCTest - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/swift$<$>:_static>/$ - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/swift$<$>:_static>/$ + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/swift$<$>:_static>/${SWIFT_INSTALL_SUBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/swift$<$>:_static>/${SWIFT_INSTALL_SUBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/swift/XCTest.swiftdoc