compnerd created this revision. Herald added a subscriber: cfe-commits. 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.
Repository: rCXX libc++ https://reviews.llvm.org/D40660 Files: include/__config Index: include/__config =================================================================== --- include/__config +++ include/__config @@ -1263,6 +1263,15 @@ # endif #endif // defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) +#if defined(_LIBCPP_ABI_MICROSOFT) +# if defined(_LIBCPP_BUILDING_LIBRARY) +# if defined(_LIBCPP_DEBUG) +# pragma(lib, "c++d.lib") +# else +# pragma(lib, "c++.lib") +# endif +# endif +#endif // defined(_LIBCPP_ABI_MICROSOFT) #endif // __cplusplus
Index: include/__config =================================================================== --- include/__config +++ include/__config @@ -1263,6 +1263,15 @@ # endif #endif // defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) +#if defined(_LIBCPP_ABI_MICROSOFT) +# if defined(_LIBCPP_BUILDING_LIBRARY) +# if defined(_LIBCPP_DEBUG) +# pragma(lib, "c++d.lib") +# else +# pragma(lib, "c++.lib") +# endif +# endif +#endif // defined(_LIBCPP_ABI_MICROSOFT) #endif // __cplusplus
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits