Skip to content

Runtimes: export the SwiftOverlay targets #83099

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
Jul 17, 2025
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions Runtimes/Overlay/Android/Android/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ target_link_libraries(swiftAndroid PRIVATE
swiftCore)

install(TARGETS swiftAndroid
EXPORT SwiftOverlayTargets
ARCHIVE DESTINATION "${SwiftOverlay_INSTALL_LIBDIR}"
LIBRARY DESTINATION "${SwiftOverlay_INSTALL_LIBDIR}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
Expand Down
1 change: 1 addition & 0 deletions Runtimes/Overlay/Android/Math/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ target_link_libraries(swift_math PRIVATE
swiftCore)

install(TARGETS swift_math
EXPORT SwiftOverlayTargets
ARCHIVE DESTINATION "${SwiftOverlay_INSTALL_LIBDIR}"
LIBRARY DESTINATION "${SwiftOverlay_INSTALL_LIBDIR}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
Expand Down
3 changes: 2 additions & 1 deletion Runtimes/Overlay/Android/clang/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ target_compile_options(SwiftAndroid INTERFACE
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xcc --sysroot=\"${CMAKE_ANDROID_NDK_TOOLCHAIN_UNIFIED}/sysroot\">"
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-vfsoverlay ${CMAKE_CURRENT_BINARY_DIR}/android-ndk-overlay.yaml>")

install(TARGETS SwiftAndroid
EXPORT SwiftOverlayTargets)
install(FILES
android.modulemap
SwiftAndroidNDK.h
SwiftBionic.h
DESTINATION ${CMAKE_INSTALL_LIBDIR}/swift/${SwiftOverlay_PLATFORM_SUBDIR}/${SwiftOverlay_ARCH_SUBDIR})

install(FILES
posix_filesystem.apinotes
spawn.apinotes
Expand Down
19 changes: 19 additions & 0 deletions Runtimes/Overlay/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,22 @@ endif()
if(WIN32)
add_subdirectory(Windows)
endif()

# Inter-project install info
export(EXPORT SwiftOverlayTargets
FILE "cmake/SwiftOverlay/SwiftOverlayTargets.cmake")
install(EXPORT SwiftOverlayTargets
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/SwiftOverlay"
FILE "SwiftOverlayTargets.cmake"
COMPONENT SwiftOverlayCMake)
include(CMakePackageConfigHelpers)
configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/interface/SwiftOverlayConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake/SwiftOverlay/SwiftOverlayConfig.cmake"
INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/SwiftOverlay")
write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/cmake/SwiftOverlay/SwiftOverlayConfigVersion.cmake"
VERSION "${PROJECT_VERSION}"
COMPATIBILITY ExactVersion)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/cmake/SwiftOverlay/SwiftOverlayConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/cmake/SwiftOverlay/SwiftOverlayConfigVersion.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/SwiftOverlay")
1 change: 1 addition & 0 deletions Runtimes/Overlay/Windows/CRT/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ target_link_libraries(swiftCRT PRIVATE
swiftCore)

install(TARGETS swiftCRT
EXPORT SwiftOverlayTargets
ARCHIVE DESTINATION "${SwiftOverlay_INSTALL_LIBDIR}"
LIBRARY DESTINATION "${SwiftOverlay_INSTALL_LIBDIR}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
Expand Down
1 change: 1 addition & 0 deletions Runtimes/Overlay/Windows/WinSDK/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ target_link_libraries(swiftWinSDK PRIVATE
swiftCore)

install(TARGETS swiftWinSDK
EXPORT SwiftOverlayTargets
ARCHIVE DESTINATION "${SwiftOverlay_INSTALL_LIBDIR}"
LIBRARY DESTINATION "${SwiftOverlay_INSTALL_LIBDIR}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
Expand Down
2 changes: 2 additions & 0 deletions Runtimes/Overlay/Windows/clang/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ add_library(ClangModules INTERFACE)
target_compile_options(ClangModules INTERFACE
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-vfsoverlay ${CMAKE_CURRENT_BINARY_DIR}/windows-sdk-overlay.yaml>")

install(TARGETS ClangModules
EXPORT SwiftOverlayTargets)
install(FILES
ucrt.modulemap
vcruntime.apinotes
Expand Down
1 change: 1 addition & 0 deletions Runtimes/Overlay/clang/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ target_link_libraries(swift_Builtin_float PRIVATE
swiftCore)

install(TARGETS swift_Builtin_float
EXPORT SwiftOverlayTargets
ARCHIVE DESTINATION "${SwiftOverlay_INSTALL_LIBDIR}"
LIBRARY DESTINATION "${SwiftOverlay_INSTALL_LIBDIR}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
Expand Down
4 changes: 4 additions & 0 deletions Runtimes/Overlay/cmake/interface/SwiftOverlayConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@PACKAGE_INIT@
include("${CMAKE_CURRENT_LIST_DIR}/SwiftOverlayTargets.cmake")

set(SwiftOverlay_ENABLE_REFLECTION @SwiftOverlay_ENABLE_REFLECTION@)