在编写时,clang 在他们的 Visual Studio 用户手册中有这个文档:
cmake -G"Visual Studio 2017" -T LLVM ..
这行不通。
我从 cmake 收到一条错误消息:
CMake Error at CMakeLists.txt:3 (project):
Failed to run MSBuild command:
C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin/MSBuild.exe
to get the value of VCTargetsPath:
Microsoft (R) Build Engine version 16.7.0+b89cb5fde for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 10/3/2020 5:06:06 PM.
Project "D:\Github\glfw\build\CMakeFiles\3.18.1\VCTargetsPath.vcxproj" on node 1 (default targets).
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(411,5): error MSB8020: The build tools for LLVM99 (Platform Toolset = 'LLVM99') cannot be found. To build using the LLVM99 build tools, please install LLVM99 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [D:\Github\glfw\build\CMakeFiles\3.18.1\VCTargetsPath.vcxproj]
Done Building Project "D:\Github\glfw\build\CMakeFiles\3.18.1\VCTargetsPath.vcxproj" (default targets) -- FAILED.
Build FAILED.
"D:\Github\glfw\build\CMakeFiles\3.18.1\VCTargetsPath.vcxproj" (default target) (1) ->
(PrepareForBuild target) ->
on, and then selecting "Retarget solution". [D:\Github\glfw\build\CMakeFiles\3.18.1\VCTargetsPath.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.11
Exit code: 1
-- Configuring incomplete, errors occurred!
See also "D:/Github/glfw/build/CMakeFiles/CMakeOutput.log".