File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -488,8 +488,13 @@ void IRGenModule::emitSourceFile(SourceFile &SF) {
488
488
this ->addLinkLibrary (LinkLibrary (" stdc++" , LibraryKind::Library));
489
489
490
490
// Do not try to link Cxx with itself.
491
- if (!getSwiftModule ()->getName ().is (" Cxx" ))
492
- this ->addLinkLibrary (LinkLibrary (" swiftCxx" , LibraryKind::Library));
491
+ if (!getSwiftModule ()->getName ().is (" Cxx" )) {
492
+ bool isStatic = Context.getModuleByName (" Cxx" )->isStaticLibrary ();
493
+ this ->addLinkLibrary (LinkLibrary (target.isOSWindows () && isStatic
494
+ ? " libswiftCxx"
495
+ : " swiftCxx" ,
496
+ LibraryKind::Library));
497
+ }
493
498
494
499
// Do not try to link CxxStdlib with the C++ standard library, Cxx or
495
500
// itself.
Original file line number Diff line number Diff line change 1
1
list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR} /../../cmake/modules )
2
2
include (StdlibOptions )
3
3
4
- set (SWIFT_CXX_LIBRARY_KIND STATIC )
5
- if ("${SWIFT_HOST_VARIANT_SDK} " STREQUAL "WINDOWS" )
6
- set (SWIFT_CXX_LIBRARY_KIND SHARED )
7
- endif ()
8
-
9
4
set (SWIFT_CXX_DEPS symlink_clang_headers )
10
5
if (SWIFT_STDLIB_SUPPORT_BACK_DEPLOYMENT )
11
6
list (APPEND SWIFT_CXX_DEPS copy-legacy-layouts )
12
7
endif ()
13
8
14
- add_swift_target_library (swiftCxx ${SWIFT_CXX_LIBRARY_KIND} NO_LINK_NAME IS_STDLIB IS_SWIFT_ONLY IS_FRAGILE
9
+ add_swift_target_library (swiftCxx STATIC NO_LINK_NAME IS_STDLIB IS_SWIFT_ONLY IS_FRAGILE
15
10
CxxConvertibleToCollection.swift
16
11
CxxDictionary.swift
17
12
CxxPair.swift
You can’t perform that action at this time.
0 commit comments