Skip to content

CMake: Fix swiftrt.o install location #79642

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions Runtimes/Core/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,13 @@ if("${SwiftCore_OBJECT_FORMAT}" STREQUAL "elfx")
"${SwiftCore_SWIFTC_SOURCE_DIR}/include"
"${PROJECT_BINARY_DIR}/include")
target_link_libraries(swiftrt PRIVATE swiftShims)
# The driver requires that swifrt.o is under `usr/lib/swift/<platform>/<arch>`
# Regardless of settings
# The driver requires that swiftrt.o is under
# `usr/lib/(swift|swift_static)/<platform>/<arch>` regardless of whether the
# other files are under the platform and architecture subdirectories:
# https://github.com/swiftlang/swift-driver/blob/f66e33575150cc778289b5f573218c7a0c70bab6/Sources/SwiftDriver/Jobs/GenericUnixToolchain%2BLinkerSupport.swift#L186
install(FILES $<TARGET_OBJECTS:swiftrt>
COMPONENT SwiftCore_runtime
DESTINATION "${CMAKE_INSTALL_LIBDIR}/swift/${SwiftCore_PLATFORM_SUBDIR}/${SwiftCore_ARCH_SUBDIR}"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/swift$<BOOL:${BUILD_SHARED_LIBS}>:_static>/${SwiftCore_PLATFORM_SUBDIR}/${SwiftCore_ARCH_SUBDIR}"
RENAME swiftrt.o)
elseif("${SwiftCore_OBJECT_FORMAT}" STREQUAL "coffx")
add_library(swiftrtT OBJECT SwiftRT-COFF.cpp)
Expand Down