使用cmake创建LLVM.sln文件时,为什么会出错?

时间:2017-09-07 01:16:50

标签: visual-studio cmake clang llvm

我尝试在Windows上构建Clang,因为http://clang.llvm.org/get_started.html中的指南 但是,当我尝试使用cmake:

创建LLVM.sln文件时发生错误
CMake Warning at CMakeLists.txt:48 (message):
  Visual Studio generators use the x86 host compiler by default, even for
  64-bit targets.  This can result in linker instability and out of memory
  errors.  To use the 64-bit host compiler, pass -Thost=x64 on the CMake
  command line.


CMake Error at CMakeLists.txt:54 (project):

Failed to run MSBuild command:

  MSBuild.exe

to get the value of VCTargetsPath:

Configuring incomplete, errors occurred!
See also "H:/build/CMakeFiles/CMakeOutput.log".

如何解决此问题并生成Visual Studio 2017文件?

enter image description here

2 个答案:

答案 0 :(得分:1)

  • 转到卸载中心(控制面板\程序\程序和功能)
  • 点击“Microsoft Visual Studio社区 2015 更新”
  • 点击CHANGE
  • 将打开Visual Studio面板,单击REPAIR选项卡并等待15分钟,然后重新启动系统。这将修复MSBuild.exe上的Cmake错误

答案 1 :(得分:0)

  1. "Failed to run MSBuild command" indicates that CMake can't find Visual Studio at all, and probably means that you selected the wrong version of Visual Studio in the dropdown. It might mean that you didn't install Visual Studio correctly.

  2. The warning you're seeing is not an error, just a warning. Since CMake is stupid, and doesn't know that it was run from within the GUI, the error message is non-helpful, as is tradition in the world of building C/C++. In order to fix it, you delete the cache, and then click on 'Generate' again. Then you can specify in a text field the argument to -T, where you enter "host=x64".