Skip to content

Commit 3806913

Browse files
authored
Merge pull request #79642 from etcwilde/ewilde/fix-linux-swiftrt-location
CMake: Fix swiftrt.o install location
2 parents 68d7b5a + 7ed975a commit 3806913

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Runtimes/Core/runtime/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,13 @@ if("${SwiftCore_OBJECT_FORMAT}" STREQUAL "elfx")
159159
"${SwiftCore_SWIFTC_SOURCE_DIR}/include"
160160
"${PROJECT_BINARY_DIR}/include")
161161
target_link_libraries(swiftrt PRIVATE swiftShims)
162-
# The driver requires that swifrt.o is under `usr/lib/swift/<platform>/<arch>`
163-
# Regardless of settings
162+
# The driver requires that swiftrt.o is under
163+
# `usr/lib/(swift|swift_static)/<platform>/<arch>` regardless of whether the
164+
# other files are under the platform and architecture subdirectories:
165+
# https://github.com/swiftlang/swift-driver/blob/f66e33575150cc778289b5f573218c7a0c70bab6/Sources/SwiftDriver/Jobs/GenericUnixToolchain%2BLinkerSupport.swift#L186
164166
install(FILES $<TARGET_OBJECTS:swiftrt>
165167
COMPONENT SwiftCore_runtime
166-
DESTINATION "${CMAKE_INSTALL_LIBDIR}/swift/${SwiftCore_PLATFORM_SUBDIR}/${SwiftCore_ARCH_SUBDIR}"
168+
DESTINATION "${CMAKE_INSTALL_LIBDIR}/swift$<BOOL:${BUILD_SHARED_LIBS}>:_static>/${SwiftCore_PLATFORM_SUBDIR}/${SwiftCore_ARCH_SUBDIR}"
167169
RENAME swiftrt.o)
168170
elseif("${SwiftCore_OBJECT_FORMAT}" STREQUAL "coffx")
169171
add_library(swiftrtT OBJECT SwiftRT-COFF.cpp)

0 commit comments

Comments
 (0)