File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -468,6 +468,10 @@ void IRGenModule::emitSourceFile(SourceFile &SF) {
468468
469469 if (ObjCInterop)
470470 this ->addLinkLibrary (LinkLibrary (" objc" , LibraryKind::Library));
471+
472+ // Automatically with libc++ when possible.
473+ if (Context.LangOpts .EnableCXXInterop && Context.LangOpts .Target .isOSDarwin ())
474+ this ->addLinkLibrary (LinkLibrary (" c++" , LibraryKind::Library));
471475
472476 // FIXME: It'd be better to have the driver invocation or build system that
473477 // executes the linker introduce these compatibility libraries, since at
Original file line number Diff line number Diff line change 1- // RUN: %target-run-simple-swift(-I %S/Inputs -Xfrontend -enable-cxx-interop -lc++ )
1+ // RUN: %target-run-simple-swift(-I %S/Inputs -Xfrontend -enable-cxx-interop)
22//
33// REQUIRES: executable_test
44//
You can’t perform that action at this time.
0 commit comments