Skip to content

Commit 30f3f86

Browse files
committed
Runtimes: manually adjust the library prefix for core,Concurrency
These libraries use C++ as the linker language which will prevent `CMAKE_STATIC_LIBRARY_PREFIX_Swift` from impacting them. Wire this property to the target manually so that it takes effect. This is primarily meant to support Windows, where we use a non-standard library prefix for static libraries mirroring the behaviour of the language runtimes (i.e. ucrt, vcruntime, msvcrt).
1 parent a9df0bd commit 30f3f86

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Runtimes/Core/Concurrency/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ target_link_libraries(swift_Concurrency PRIVATE
130130
set_target_properties(swift_Concurrency PROPERTIES
131131
Swift_MODULE_NAME _Concurrency
132132
LINKER_LANGUAGE CXX)
133+
if(NOT BUILD_SHARED_LIBS AND CMAKE_STATIC_LIBRARY_PREFIX_Swift)
134+
set_target_properties(swift_Concurrency PROPERTIES
135+
PREFIX ${CMAKE_STATIC_LIBRARY_PREFIX_Swift})
136+
endif()
133137

134138
install(TARGETS swift_Concurrency
135139
EXPORT SwiftCoreTargets

Runtimes/Core/core/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,10 @@ endif()
281281
set_target_properties(swiftCore PROPERTIES
282282
Swift_MODULE_NAME Swift
283283
LINKER_LANGUAGE CXX)
284+
if(NOT BUILD_SHARED_LIBS AND CMAKE_STATIC_LIBRARY_PREFIX_Swift)
285+
set_target_properties(swiftCore PROPERTIES
286+
PREFIX ${CMAKE_STATIC_LIBRARY_PREFIX_Swift})
287+
endif()
284288

285289
target_compile_definitions(swiftCore
286290
PRIVATE

0 commit comments

Comments
 (0)