File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed
Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -488,8 +488,15 @@ void IRGenModule::emitSourceFile(SourceFile &SF) {
488488 this ->addLinkLibrary (LinkLibrary (" stdc++" , LibraryKind::Library));
489489
490490 // 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 = false ;
493+ if (const auto *M = Context.getModuleByName (" Cxx" ))
494+ isStatic = M->isStaticLibrary ();
495+ this ->addLinkLibrary (LinkLibrary (target.isOSWindows () && isStatic
496+ ? " libswiftCxx"
497+ : " swiftCxx" ,
498+ LibraryKind::Library));
499+ }
493500
494501 // Do not try to link CxxStdlib with the C++ standard library, Cxx or
495502 // itself.
Original file line number Diff line number Diff line change 11list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR} /../../cmake/modules)
22include (StdlibOptions)
33
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-
94set (SWIFT_CXX_DEPS symlink_clang_headers)
105if (SWIFT_STDLIB_SUPPORT_BACK_DEPLOYMENT)
116 list (APPEND SWIFT_CXX_DEPS copy-legacy-layouts)
127endif ()
138
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
1510 CxxConvertibleToCollection.swift
1611 CxxDictionary.swift
1712 CxxPair.swift
You can’t perform that action at this time.
0 commit comments