Building LLVM with static linking on Windows

I’m trying to build LLVM 3.5.1 on Windows, almost successfully; the remaining stumbling block is getting static linking for release builds. The problem is that the .vcxproj is interpreted by msbuild to compile with the /MD option instead of /MT, as detailed in:

Haven’t got any answers on that question, and discussion in:

suggests msbuild isn’t even capable of such.

What’s the best way to get a static release build?

You need to cmake with



for static linking with Debug and Release configurations reprectively.


That works, thanks!