Reputation: 11
I try to build Clang on Windows as the guide told in http://clang.llvm.org/get_started.html However,an error occurs when I try to create an LLVM.sln file with cmake:
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".
How to solve this problem and generate a Visual Studio 2017 file?
Upvotes: 1
Views: 654
Reputation: 11
Upvotes: 1
Reputation: 5510
"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.
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".
Upvotes: 0