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()