Skip to content

Commit 16b20ca

Browse files
authored
Merge pull request #6466 from hughbe/empty-sdk-windows
Don't pass empty "/" SDK path to the swift compiler when compiling the stdlib
2 parents 90d7da8 + c94e2a1 commit 16b20ca

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,12 @@ function(_add_variant_swift_compile_flags
260260
sdk arch build_type enable_assertions result_var_name)
261261
set(result ${${result_var_name}})
262262

263+
# On Windows, we don't set SWIFT_SDK_WINDOWS_PATH, so don't include it.
264+
if (NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
265+
list(APPEND result "-sdk" "${SWIFT_SDK_${sdk}_PATH}")
266+
endif()
267+
263268
list(APPEND result
264-
"-sdk" "${SWIFT_SDK_${sdk}_PATH}"
265269
"-target" "${SWIFT_SDK_${sdk}_ARCH_${arch}_TRIPLE}"
266270
"-resource-dir" "${SWIFTLIB_DIR}")
267271

0 commit comments

Comments
 (0)