Building llvm-mos on Windows

Generally speaking, builds of llvm-mos on Windows are finicky and opinionated, because LLVM itself is finicky and opinionated to build on Windows. I use a stable release of LLVM to compile LLVM.

When checking out from git, it's important to make sure that core.autocrlf is set to False. Windows installations strongly encourage you to set this to true, but if you do, then LLVM acceptance tests will fail.

To set up a Windows development and testing machine, I install Chocolatey first, at an administrator PowerShell prompt: Then, I run the following commands to install all prerequisites: The LLVM documentation suggests that you need the GnuWin32 utilities, but I don't think that's necessary; you can simply use the ones that the Windows version of git installs at. You can point the LLVM_LIT_TOOLS_DIR build variable at that directory, and llvm-lit will use all the tools in that directory for building the check-all target.

As of this writing, my Windows build batch file looks like this: