Skip to content

Commit

Permalink
Install the foundation toolchain module during the static swift build (
Browse files Browse the repository at this point in the history
  • Loading branch information
jmschonfeld authored Jun 18, 2024
1 parent ee97538 commit af8349c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Sources/Collections/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,18 @@ if(COLLECTIONS_SINGLE_MODULE)
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})

if(COLLECTIONS_FOUNDATION_TOOLCHAIN_MODULE)
# Install only the swift module and not the library
get_swift_host_os(swift_os)
if(BUILD_SHARED_LIBS)
# Install only the swift module and not the library
set(swift swift)
else()
# Install both the swift module and the binary
set(swift swift_static)
install(TARGETS ${COLLECTIONS_MODULE_NAME}
ARCHIVE DESTINATION lib/swift_static/${swift_os}
LIBRARY DESTINATION lib/swift_static/${swift_os}
RUNTIME DESTINATION bin)
endif()
get_swift_host_os(swift_os)
get_swift_host_arch(swift_arch)
install(FILES $<TARGET_PROPERTY:${COLLECTIONS_MODULE_NAME},Swift_MODULE_DIRECTORY>/${COLLECTIONS_MODULE_NAME}.swiftdoc
DESTINATION lib/${swift}/${swift_os}/${COLLECTIONS_MODULE_NAME}.swiftmodule
Expand Down

0 comments on commit af8349c

Please sign in to comment.