From 46112a992acfc97ad4c55f9f1a4238357c6feeac Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Thu, 16 Jan 2025 15:57:55 -0800 Subject: [PATCH] Runtimes: adjust installation of swifrt.{o,obj} Install the Swift registrar into the correct location for the SDK. This file is to be placed into /usr/lib/swift// with the name `swiftrt.[o|obj]`. --- Runtimes/Core/runtime/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Runtimes/Core/runtime/CMakeLists.txt b/Runtimes/Core/runtime/CMakeLists.txt index 99c95943ecb1a..5866fe940c483 100644 --- a/Runtimes/Core/runtime/CMakeLists.txt +++ b/Runtimes/Core/runtime/CMakeLists.txt @@ -149,13 +149,17 @@ if("${SwiftCore_OBJECT_FORMAT}" STREQUAL "elfx") "${SwiftCore_SWIFTC_SOURCE_DIR}/include" "${PROJECT_BINARY_DIR}/include") target_link_libraries(swiftrt PRIVATE swiftShims) - install(TARGETS swiftrt DESTINATION "${CMAKE_INSTALL_LIBDIR}/swift") + install(FILES $ + DESTINATION "${CMAKE_INSTALL_LIBDIR}/swift/${SwiftCore_PLATFORM_SUBDIR}/${SwiftCore_ARCH_SUBDIR}" + RENAME swiftrt.o) elseif("${SwiftCore_OBJECT_FORMAT}" STREQUAL "coffx") add_library(swiftrt OBJECT SwiftRT-COFF.cpp) target_compile_definitions(swiftrt PRIVATE $<$>:SWIFT_STATIC_STDLIB>) target_link_libraries(swiftrt PRIVATE swiftShims) - install(TARGETS swiftrt DESTINATION "${CMAKE_INSTALL_LIBDIR}/swift") + install(FILES $ + DESTINATION "${CMAKE_INSTALL_LIBDIR}/swift/${SwiftCore_PLATFORM_SUBDIR}/${SwiftCore_ARCH_SUBDIR}" + RENAME swiftrt.obj) elseif(NOT "${SwiftCore_OBJECT_FORMAT}" STREQUAL "x") message(SEND_ERROR "Unknown object format '${SwiftCore_OBJECT_FORMAT}'") endif()