From a92598b6ca01405e4cfcd4278fd4db5f72c24fc5 Mon Sep 17 00:00:00 2001 From: Stuart Montgomery Date: Tue, 26 Nov 2024 11:41:26 -0600 Subject: [PATCH] Don't install the binary Swift module when building for Apple platforms --- cmake/modules/SwiftModuleInstallation.cmake | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cmake/modules/SwiftModuleInstallation.cmake b/cmake/modules/SwiftModuleInstallation.cmake index b291f1ff0..261284236 100644 --- a/cmake/modules/SwiftModuleInstallation.cmake +++ b/cmake/modules/SwiftModuleInstallation.cmake @@ -86,13 +86,17 @@ function(_swift_testing_install_target module) install(FILES $/${module_name}.swiftdoc DESTINATION "${module_dir}" RENAME ${SwiftTesting_MODULE_TRIPLE}.swiftdoc) - install(FILES $/${module_name}.swiftmodule - DESTINATION "${module_dir}" - RENAME ${SwiftTesting_MODULE_TRIPLE}.swiftmodule) if(APPLE) # Only Darwin has stable ABI. install(FILES $/${module_name}.swiftinterface DESTINATION "${module_dir}" RENAME ${SwiftTesting_MODULE_TRIPLE}.swiftinterface) + else() + # Only install the binary .swiftmodule on platforms which do not have a + # stable ABI. Other platforms will use the textual .swiftinterface + # (installed above) and this limits access to this module's SPIs. + install(FILES $/${module_name}.swiftmodule + DESTINATION "${module_dir}" + RENAME ${SwiftTesting_MODULE_TRIPLE}.swiftmodule) endif() endfunction()