Skip to content

Runtimes: fix the install location for -static #78722

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

Closed
wants to merge 1 commit into from
Closed
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
7 changes: 5 additions & 2 deletions Runtimes/Core/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,12 @@ elseif(NOT APPLE AND NOT LINUX AND NOT ANDROID AND UNIX)
target_link_libraries(swiftCore PRIVATE "${EXECINFO_LIBRARY}")
endif()

install(TARGETS swiftCore)
install(TARGETS swiftCore
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}/$<$<NOT:$<PLATFORM_ID:Darwin>>:swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>/${SwiftCore_PLATFORM_SUBDIR}/${SwiftCore_ARCH_SUBDIR}>"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}/$<$<NOT:$<PLATFORM_ID:Darwin>>:swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>/${SwiftCore_PLATFORM_SUBDIR}/${SwiftCore_ARCH_SUBDIR}>"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The <platform>/<arch> install directory is not correct for all build configurations either. The macOS builds, for instance, should be to /usr/lib/swift/libswiftCore.dylib, not /usr/lib/swift/macosx/arm64. Please add an option to disable the including the extra directories. Same for the swift module.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The $<NOT:$<PLATFORM_ID:Darwin>> does that though. Is there a reason to generalise this into an option?

RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/Swift.swiftmodule"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/swift/Swift.swiftmodule"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>/${SwiftCore_PLATFORM_SUBDIR}/Swift.swiftmodule"
RENAME "${SwiftCore_MODULE_TRIPLE}.swiftmodule")
emit_swift_interface(swiftCore)
install_swift_interface(swiftCore)
Expand Down