[PATCH] D40660: Enable auto-linking on Windows

Shoaib Meenai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 30 11:24:49 PST 2017


smeenai added inline comments.


================
Comment at: include/__config:1266
+#if defined(_LIBCPP_ABI_MICROSOFT)
+# if defined(_DLL) && !defined(_LIBCPP_BUILDING_LIBRARY)
+#   if defined(_LIBCPP_DEBUG)
----------------
This feels more like a Windows (or perhaps COFF) thing than a Microsoft ABI thing.


================
Comment at: include/__config:1267
+# if defined(_DLL) && !defined(_LIBCPP_BUILDING_LIBRARY)
+#   if defined(_LIBCPP_DEBUG)
+#     pragma comment(lib, "c++d.lib")
----------------
I guess `_DLL` is appropriate here. Ideally though I think adding the pragma should be keyed on exactly the same conditional that determines whether we annotate with dllexport/dllimport, and right now that's only conditional on `_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS`.


================
Comment at: include/__config:1269
+#     pragma comment(lib, "c++d.lib")
+#   else
+#     pragma comment(lib, "c++.lib")
----------------
We never create a `c++d.lib`, as far as I can see. It's always either `c++.lib` for the import library or `libc++.lib` for the static library.


https://reviews.llvm.org/D40660





More information about the cfe-commits mailing list