clion使用clang编译
1.下载mingw,下载地址https://nuwen.net/mingw.html,然后安装或解压
2.下载clang,下载地址http://llvm.org/releases/download.html,然后安装或解压
3.打开clion -> Build,Execution,Deployment -> Toolchains 添加MinGW -> 在Environment内设置MinGW所在地址,然后点击确认等待运行完成
4.打开clion -> Build,Execution,Deployment -> Toolchains的MinGW选项,修改C Compiler和C++ Compiler为clang和clang++地址
5.打开clion -> Build,Execution,Deployment -> CMake,在CMake Options填入
-D CMAKE_C_COMPILER= C:\Program Files\LLVM\bin\clang.exe
-D CMAKE_CXX_COMPILER= C:\Program Files\LLVM\bin\clang++.exe