MSBuild Error When Trying to Configure CMake

  • Thread starter Thread starter DragonOsman2
  • Start date Start date
D

DragonOsman2

Guest
Hi. I was trying to configure CMake to build LLVM version 10. I want to build Qt along with the Documentation which requires LLVM; I want to build Qt for WebAssembly and it detected LLVM version 10 with EMSDK, so since I want to avoid version conflicts, I thought I'd try to build LLVM version 10 myself. I tried running this command on the command line:

"cmake -DCMAKE_INSTALL_PREFIX=../install -G"Visual Studio 16 2019" -Thost=x64 -A x86 -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lld;lldb;libcxx;libcxxabi" -DCMAKE_BUILD-TYPE=Release -MSVC_RUNTIME_TYPE=/MT -DLLVM_TARGETS_TO_BUILD=all -DLLVM_ENABLE_THREADS=On -DLLVM_CXX_STD="c++17" -DLLVM_ENABLE_PEDANTIC=On -DCMAKE_CXX_FLAGS="/std:c++17;/permissive-;/MT;/EHsc" ../llvm"

And it gave this output (please notice the errors):

"

CMake Error at CMakeLists.txt:49 (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.3.2+e481bbf88 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 10/26/2019 9:13:23 PM.
Project "C:\llvm-project\build\CMakeFiles\3.15.4\VCTargetsPath.vcxproj" on node 1 (default targets).
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(376,5): error MSB8013: This project doesn't contain the Configuration and Platform combination of Debug|Win32. [C:\llvm-project\build\CMakeFiles\3.15.4\VCTargetsPath.vcxproj]
Done Building Project "C:\llvm-project\build\CMakeFiles\3.15.4\VCTargetsPath.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\llvm-project\build\CMakeFiles\3.15.4\VCTargetsPath.vcxproj" (default target) (1) ->
(PrepareForBuild target) ->
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(376,5): error MSB8013: This project doesn't contain the Configuration and Platform combination of Debug|Win32. [C:\llvm-project\build\CMakeFiles\3.15.4\VCTargetsPath.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:02.86

Exit code: 1

-- Configuring incomplete, errors occurred!
See also "C:/llvm-project/build/CMakeFiles/CMakeOutput.log"."

What's the reason for this error? Could someone please help me out? And if I want to do all of this from within the IDE, how should I change the CMake settings to configure it the way I want?

Edit: I was able to start the configuration process but even though I specified this in my command line arguments: "-DMSVC_RUNTIME_TYPE=/MT", it's still using /MD instead of /MT here. I want a static build. What do I do?



Edit2: And I also want it to write all project files to C:/llvm-project/build. Is that possible?

Continue reading...
 
Back
Top