[libcxx] r323300 - libcxx: Allow auto-linking to be disabled with a macro.

Peter Collingbourne via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 23 20:30:19 PST 2018


Author: pcc
Date: Tue Jan 23 20:30:19 2018
New Revision: 323300

URL: http://llvm.org/viewvc/llvm-project?rev=323300&view=rev
Log:
libcxx: Allow auto-linking to be disabled with a macro.

Some users may have a custom build system which gives a different
name to the libc++ archive (or does not create an archive at all,
instead passing the object files directly to the linker). Give those
users a way to disable auto-linking.

Differential Revision: https://reviews.llvm.org/D42436

Modified:
    libcxx/trunk/include/__config

Modified: libcxx/trunk/include/__config
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=323300&r1=323299&r2=323300&view=diff
==============================================================================
--- libcxx/trunk/include/__config (original)
+++ libcxx/trunk/include/__config Tue Jan 23 20:30:19 2018
@@ -1285,13 +1285,15 @@ _LIBCPP_FUNC_VIS extern "C" void __sanit
 # endif
 #endif // defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO)
 
-#if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_BUILDING_LIBRARY)
-# if defined(_DLL)
+#ifndef _LIBCPP_NO_AUTO_LINK
+# if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_BUILDING_LIBRARY)
+#  if defined(_DLL)
 #   pragma comment(lib, "c++.lib")
-# else
+#  else
 #   pragma comment(lib, "libc++.lib")
-# endif
-#endif // defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_BUILDING_LIBRARY)
+#  endif
+# endif // defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_BUILDING_LIBRARY)
+#endif // _LIBCPP_NO_AUTO_LINK
 
 #endif // __cplusplus
 




More information about the cfe-commits mailing list