From 69b44433047dc54c537d83e3361eaf0e09e36b7d Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Fri, 10 Oct 2025 08:38:24 -0700 Subject: [PATCH] Distributed: repair the build for Windows with early swift-driver When we enable the early swift-driver, CMP0157 will be enabled, changing the linker language for the library, changing the library prefix. Correct this for that scenario. --- Runtimes/Supplemental/Distributed/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Runtimes/Supplemental/Distributed/CMakeLists.txt b/Runtimes/Supplemental/Distributed/CMakeLists.txt index bded5de9320fa..a802147d72c7e 100644 --- a/Runtimes/Supplemental/Distributed/CMakeLists.txt +++ b/Runtimes/Supplemental/Distributed/CMakeLists.txt @@ -111,6 +111,13 @@ cmake_policy(GET CMP0157 Policy157Enabled) if(Policy157Enabled STREQUAL NEW) set_target_properties(swiftDistributed PROPERTIES LINKER_LANGUAGE CXX) + # `CMAKE_STATIC_LIBRARY_PREFIX_Swift` will not impact the prefix for this + # library because we have changed the linker language to C++. This is required + # for Windows to properly reference this library. + if(NOT BUILD_SHARED_LIBS) + set_target_properties(swiftDistributed PROPERTIES + PREFIX lib) + endif() endif() target_compile_definitions(swiftDistributed PRIVATE