Skip to content

Commit d963e0b

Browse files
authored
build: support a non-standard library prefix for Windows (#1143)
In preparation for supporting static library linking on Windows, we are adjusting the library naming convention for static Swift libraries, preferring to use `lib<name>.lib` to differentiate them from the import library for a dynamic variant of the same library. This mechanism is already known to be used by Microsoft for ucrt (`ucrt.lib` vs `libucrt.lib`), and was previously used in Swift as well for the C++ interop libraries.
1 parent c55993d commit d963e0b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/FoundationEssentials/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ if(NOT BUILD_SHARED_LIBS)
9696
target_compile_options(FoundationEssentials PRIVATE
9797
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -public-autolink-library -Xfrontend _FoundationCShims>")
9898
target_compile_options(FoundationEssentials PRIVATE
99-
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -public-autolink-library -Xfrontend _FoundationCollections>")
99+
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -public-autolink-library -Xfrontend $<$<PLATFORM_ID:Windows>:${CMAKE_STATIC_LIBRARY_PREFIX_Swift}>_FoundationCollections>")
100100
target_compile_options(FoundationEssentials PRIVATE
101101
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -public-autolink-library -Xfrontend swiftSynchronization>")
102102
endif()

0 commit comments

Comments
 (0)