llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.54k stars 12.22k forks source link

LLVM compiler toolchain extension does not work for Microsoft Visual Studio 2019 #41103

Open amitin opened 5 years ago

amitin commented 5 years ago
Bugzilla Link 41758
Version 8.0
OS All
CC @zmodem

Extended Description

Having installed MSVS 2019 Professional and 'LLVM Compiler Toolchain' extension, I use -T"llvm" cmake argument for my cmake-based project to get it targeted to llvm toolset. But Visual Studio 2019 reports that it's an unknown toolset. Attempting to manually retarget my project generated with standard toolset has no effect because I cannot see 'llvm' as an optional toolset in MSVS IDE.

However, it works just fine with Visual Studio 2017.

As a workaround, I copied all llvm-related stuff from C:\Program Files\Microsoft Visual Studio\2019\Professional\Common7\IDE\VC\VCTargets to C:\Program Files\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VC\v160

amitin commented 5 years ago

Can the information from here help? https://github.com/zufuliu/llvm-utils

amitin commented 5 years ago

Yes, I can see it installed and its version is 1.0.359557. See attachment.

Additionally, here is cmake output while I attempt to configure my project with -T"llvm". C:\Program Files\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(378,5): error MSB8020: The build tools for llvm (Platform Toolset = 'llvm') cannot be found. To build using the llvm build tools, please install llvm 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". [C:\workspace\test\CMakeFiles\3.14.0\VCTargetsPath.vcxproj]

amitin commented 5 years ago

Visual Studio extension manager with LLVM extension installed

zmodem commented 5 years ago

Attempting to manually retarget my project generated with standard toolset has no effect because I cannot see 'llvm' as an optional toolset in MSVS IDE.

If you can't see LLVM in the Platform Toolshet option list in the MSVS IDE, then it seems the extension isn't installed properly in VS2019.

Does it show up in the Extensions > Manage Extensions menu?

It's only the latest version of the extension (1.0.359557) that installs into VS2019. Is that the version you have?