Visual Studio 2017 编译Clang
到http://releases.llvm.org/download.html下载LLVM和clang源码
比如:
http://releases.llvm.org/6.0.0/llvm-6.0.0.src.tar.xz
http://releases.llvm.org/6.0.0/cfe-6.0.0.src.tar.xz
将llvm-6.0.0.src.tar.xz解压到D:\LLVM
将cfe-6.0.0.src.tar.xz解压到D:\LLVM\tools\
将cfe-6.0.0.src重命名位clang
到https://cmake.org/download/下载cmake,双击cmake-gui,在where is source code处填写D:\LLVM
where to build the binaries 处填写一个生成vs解决方案的地方
点击configure,填入如下信息,
选生成器的时候,带着win64则生成64位的解决方案,不带则生成32解决方案。
host=x64建议填写,否则编译的时候会出现
类似“The problem arises when the build process gets to the "clangBasic" project. It fails on line 254 of "identifiertable.cpp," which I will attach. All other projects that depend on clangBasic fail. This bug only arises on the Release configuration.”
的fatal error C1002: 在第2遍中编译器的堆空间不足错误提示。