Skip to content

Commit cc867af

Browse files
authored
Merge pull request #6498 from hughbe/windows-dependencies
Fix Windows dependency library names
2 parents 5b42230 + d90b3af commit cc867af

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -949,10 +949,17 @@ function(_add_swift_library_single target name)
949949
set(prefixed_link_libraries)
950950
foreach(dep ${SWIFTLIB_SINGLE_LINK_LIBRARIES})
951951
if("${dep}" MATCHES "^clang")
952-
set(dep "${LLVM_LIBRARY_OUTPUT_INTDIR}/lib${dep}.a")
953-
endif()
954-
if("${dep}" STREQUAL "cmark")
955-
set(dep "${CMARK_LIBRARY_DIR}/lib${dep}.a")
952+
if("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "WINDOWS")
953+
set(dep "${LLVM_LIBRARY_OUTPUT_INTDIR}/${dep}.lib")
954+
else()
955+
set(dep "${LLVM_LIBRARY_OUTPUT_INTDIR}/lib${dep}.a")
956+
endif()
957+
elseif("${dep}" STREQUAL "cmark")
958+
if("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "WINDOWS")
959+
set(dep "${CMARK_LIBRARY_DIR}/${dep}.lib")
960+
else()
961+
set(dep "${CMARK_LIBRARY_DIR}/lib${dep}.a")
962+
endif()
956963
endif()
957964
list(APPEND prefixed_link_libraries "${dep}")
958965
endforeach()

0 commit comments

Comments
 (0)