[llvm] r187907 - On Windows, autolink advapi32 from Path.inc for CryptAcquireContextW

Reid Kleckner reid at kleckner.net
Wed Aug 7 13:19:31 PDT 2013


Author: rnk
Date: Wed Aug  7 15:19:31 2013
New Revision: 187907

URL: http://llvm.org/viewvc/llvm-project?rev=187907&view=rev
Log:
On Windows, autolink advapi32 from Path.inc for CryptAcquireContextW

This allows llvm-tblgen to link successfully when compiling with clang.

Both MSBuild and CMake will automatically add advapi32 as part of a set
of other dlls comprising the win32 API to the link line, but CMake
doesn't do that when compiling with clang.  Until someone adds that info
to cmake upstream, this seems like a reasonable work around.

Modified:
    llvm/trunk/lib/Support/Windows/Path.inc

Modified: llvm/trunk/lib/Support/Windows/Path.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Windows/Path.inc?rev=187907&r1=187906&r2=187907&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Windows/Path.inc (original)
+++ llvm/trunk/lib/Support/Windows/Path.inc Wed Aug  7 15:19:31 2013
@@ -31,6 +31,10 @@
 typedef int errno_t;
 #endif
 
+#ifdef _MSC_VER
+# pragma comment(lib, "advapi32.lib")  // This provides CryptAcquireContextW.
+#endif
+
 using namespace llvm;
 
 namespace {





More information about the llvm-commits mailing list