Skip to content

Commit 6d53a58

Browse files
compnerdaciidgh
authored andcommitted
build: workaround CMake 3.15 link failures on Windows
The libraries would be linked without the `-l` prefix on Windows which works when using absolute paths and C/C++ but not Swift as the driver will try to read the import library locally.
1 parent bb1c0cd commit 6d53a58

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ set(SWIFT_VERSION 5)
66
set(CMAKE_Swift_LANGUAGE_VERSION ${SWIFT_VERSION})
77
if(CMAKE_VERSION VERSION_LESS 3.16)
88
add_compile_options($<$<COMPILE_LANGUAGE:Swift>:-swift-version$<SEMICOLON>${SWIFT_VERSION}>)
9+
# Workaround for CMake 3.15 which doesn't link libraries properly on Windows
10+
set(CMAKE_LINK_LIBRARY_FLAG "-l")
911
endif()
1012

1113
set(CMAKE_Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/swift)

0 commit comments

Comments
 (0)