Skip to content

Commit 23b2a4a

Browse files
authored
Merge pull request #6462 from hughbe/libraries-windows
Fix linking libraries on Windows
2 parents ff04518 + cceba6c commit 23b2a4a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ function(_add_swift_library_single target name)
810810
endif()
811811
endif()
812812

813-
if("${SWIFTLIB_SINGLE_SDK}" STREQUAL "WINDOWS")
813+
if("${SWIFTLIB_SINGLE_SDK}" STREQUAL "WINDOWS" AND NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
814814
if("${libkind}" STREQUAL "SHARED")
815815
# Each dll has an associated .lib (import library); since we may be
816816
# building on a non-DLL platform (not windows), create an imported target
@@ -1141,7 +1141,7 @@ function(_add_swift_library_single target name)
11411141
# libraries are only associated with shared libraries, so add an
11421142
# additional check for that as well.
11431143
set(import_library ${library})
1144-
if(TARGET ${library})
1144+
if(TARGET ${library} AND NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
11451145
get_target_property(type ${library} TYPE)
11461146
if(${type} STREQUAL "SHARED_LIBRARY")
11471147
set(import_library ${library}_IMPLIB)

0 commit comments

Comments
 (0)