[cfe-dev] Compiling a simple Win32 program

Nikola Smiljanic popizdeh at gmail.com
Thu Jun 7 05:07:36 PDT 2012


I think this should do the trick. I'm only unsure about the declaration for
getVisualStudioDir that I had to add. Could somebody please review and
commit this?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120607/6fa8a5b1/attachment.html>
-------------- next part --------------
Index: lib/Driver/WindowsToolChain.cpp
===================================================================
--- lib/Driver/WindowsToolChain.cpp	(revision 158139)
+++ lib/Driver/WindowsToolChain.cpp	(working copy)
@@ -25,6 +25,8 @@
   #define NOGDI
   #define NOMINMAX
   #include <Windows.h>
+
+  static bool getVisualStudioDir(std::string &path);
 #endif
 
 using namespace clang::driver;
@@ -33,6 +35,9 @@
 
 Windows::Windows(const Driver &D, const llvm::Triple& Triple)
   : ToolChain(D, Triple) {
+  std::string path;
+  if (getVisualStudioDir(path))
+	getProgramPaths().push_back(path + "\\VC\\bin");
 }
 
 Tool &Windows::SelectTool(const Compilation &C, const JobAction &JA,


More information about the cfe-dev mailing list