[ samkhn Home | Comments or bugs? Contact me ]


Setup LLVM development on Windows

Published: February 5, 2023

Recommendation 0: Read the docs mainly. LLVM docs are actually good. This will cover some areas in between what's documented and what works. I'll try to eventually merge this into the mainline LLVM docs.

Recommendation 1: Create a shell just for LLVM. First create a batch script that sets the PATH to LLVM dependencies (called something like llvm-setup.bat). Create a shortcut for cmd.exe. Have the shortcut run %comspec% /k "C:\path\to\llvm-setup.bat".

Here is what I ended up using

Some nice features of the batch script

Recommendation 2: PTAL at path\to\llvm-project\llvm\utils. Emacs, vim and editor configs are stored here.

Recommendation 3: Create your own build script that calls CMake (unless you want to manually type it in).

Here is what I ended up using (assuming you are using the LLVM shell, which gives access to 64 bit MSVC cl.exe)

Some suggestions and gotchas to look out for