summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2017-12-05 19:32:49 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2017-12-05 19:32:49 +0000
commit74f41817a595c5d18a66671bf99f951bd5900d6e (patch)
tree10df7391bfa1f5632867e18def07e9888bb863a3
parent833c260a4bce2662cebff6c3a36513f0da88f55f (diff)
downloadbcm5719-llvm-74f41817a595c5d18a66671bf99f951bd5900d6e.tar.gz
bcm5719-llvm-74f41817a595c5d18a66671bf99f951bd5900d6e.zip
Enable auto-linking on Windows
The MSVC driver and clang do not link against the C++ runtime explicitly. Instead, they rely on the auto-linking via the pragma (through `use_ansi.h`) to link against the correct version of the C++ runtime. Attempt to do something similar here so that linking real C++ code on Windows does not require the user to explicitly specify `c++.lib` when using libc++ as a C++ runtime on windows. llvm-svn: 319816
-rw-r--r--libcxx/include/__config7
1 files changed, 7 insertions, 0 deletions
diff --git a/libcxx/include/__config b/libcxx/include/__config
index c3c92af3200..0d933f806cf 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -1265,6 +1265,13 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
# endif
#endif // defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO)
+#if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_BUILDING_LIBRARY)
+# if defined(_DLL)
+# pragma(lib, "c++.lib")
+# else
+# pragma(lib, "libc++.lib")
+# endif
+#endif // defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_BUILDING_LIBRARY)
#endif // __cplusplus
OpenPOWER on IntegriCloud