Skip to content

Commit 1b10346

Browse files
committed
Runtimes: fix the install location for -static
When building the static SDK, we need to adjust the install locations so that the driver search will find the proper swiftmodule and library. The changes here adjust the install to use `swift_static` when building statically.
1 parent 6b2fb2e commit 1b10346

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Runtimes/Core/core/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,12 @@ elseif(NOT APPLE AND NOT LINUX AND NOT ANDROID AND UNIX)
325325
target_link_libraries(swiftCore PRIVATE "${EXECINFO_LIBRARY}")
326326
endif()
327327

328-
install(TARGETS swiftCore)
328+
install(TARGETS swiftCore
329+
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>/${SwiftCore_PLATFORM_SUBDIR}/${SwiftCore_ARCH_SUBDIR}"
330+
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>/${SwiftCore_PLATFORM_SUBDIR}/${SwiftCore_ARCH_SUBDIR}"
331+
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
329332
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/Swift.swiftmodule"
330-
DESTINATION "${CMAKE_INSTALL_LIBDIR}/swift/Swift.swiftmodule"
333+
DESTINATION "${CMAKE_INSTALL_LIBDIR}/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>/${SwiftCore_PLATFORM_SUBDIR}/${SwiftCore_ARCH_SUBDIR}/Swift.swiftmodule"
331334
RENAME "${SwiftCore_MODULE_TRIPLE}.swiftmodule")
332335
emit_swift_interface(swiftCore)
333336
install_swift_interface(swiftCore)

0 commit comments

Comments
 (0)