[cfe-dev] LLVM-Clang Windows Setup

John Thompson john.thompson.jtsoftware at gmail.com
Thu Jul 23 09:06:08 PDT 2009

Adding a Windows section to the Getting Started page would be very helpful.
Also some tips on using svn would help those of us new to it.  Some of this
I was able to glean or at least be hinted at in the LLVM docs (i.e.
http://llvm.org/docs/GettingStartedVS.html), but it was kind of hard to
find, and possibly not entirely up-to-date, so gathering it in one place
would be helpful.  Some tidbits from my experience:

1.  Basically, I found that only running "cmake ." at the top level LLVM
directory is the only usage that worked for me.  This creates the project
and solution files  for Visual Studio, apparently for VS2005
2. To use VS, load the LLVM.sln file in the llvm top level directory.
3. To build the clang front end, build clang-cc.  (Initially, I tried
building and running the "clang" project, which apparently is the compiler
driver, but for just running the clang front end, clang-cc is all you need.
At the time, I couldn't get the driver to work for me, always giving some
error, and then I found I could just run clang-cc.  Building the "ALL-BUILD"
project actually just worked for me for the first time, which builds the
llvm stuff too, but clang-cc has been enough for my front-end work.)
4. After doing the initial checkout ("svn co (trunk) (dir)" of both the llvm
and clang repositories), thereafter you can just run "svn update" to update
your existing tree to the latest.  Note that you have to do it for both the
llvm and llvm\tools\clang directories seperately.  If you made changes, it
will also perform merges.  During the update, a letter preceding the file
name in the output gives the status of each file.  It would be very
helpful to read at least the "Basic Usage" chapter in the svn docs,
especially if you need to resolve conflicts ("C" status).
5. To make patches, I created the following batch file:
  rem Create a diff file for Clang. Usage: clangdiff (llvm path) (patch
  svn diff -x -u %1 >\(put your patch output dir here)\%2
Note that the paths embedded in the patch depend on where you run it, so I
usually cd to the llvm directory and use tools/clang for the first argument
to cover all of clang.

I'm currently trying to figure out how to run the tests.  I'm guessing you
just build the "clang-test" project, but I'm gettting errors in the python
stuff.  I'll put this in a separate message to keep this one focused on the
Windows setup.


John Thompson
John.Thompson.JTSoftware at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090723/ce923ac5/attachment.html>

More information about the cfe-dev mailing list