Page MenuHomePhabricator

VS 2017 clang integration

Authored by dtarditi on Jul 3 2018, 10:37 AM.



Add support for integrating clang as a platform toolset for Visual Studio 2017.

In prior versions of Visual Studio, MSBuild was installed separately in its own known directory location and the platform toolset information was placed within that direcotry. In VS2017, MSBuild is installed in the VS 2017 directory and the platform toolset information is placed in a different directory within the VS 2017 directory. Use the vswhere program ( to locate the installation of VS 2017. vswhere is guaranteed to be placed in a known location on a machine, and can then be used to locate VS 2017 installs. With that information we can install the .props and .targets files for MSBuild. These are slightly modified versions of the (misnamed) VS 2014 files.

Visual Studio allows side-by-side installations, including installations of different products (Community, Professional, and Enterprise) with the same version and the same product with the same version. For now, just use the latest version of VS 2017 in the install and uninstall scripts, so we get predictable behavior. We leave it as future work for someone else to deal with side-by-side installs.

Testing: this change is being backported from Other people have tried out the change there and it has worked for them. I locally built a clean version of the Windows LLVM installer with the backported change and tried it out. It worked fine.

Diff Detail

Event Timeline

dtarditi created this revision.Jul 3 2018, 10:37 AM

I'm not a big fan of the .bat file installation method. For one it's going to require updating again with vs2019, which history shows nobody will ever do, and secondly it's just very hacky and not really the way things shoudl be done. I wrote a patch several months ago which makes a vsix that you can just install from the marketplace.

Can you try that out and let me know your thoughts?

dtarditi changed the repository for this revision from rC Clang to rL LLVM.Jul 3 2018, 11:20 AM
dtarditi added a subscriber: hans.Jul 3 2018, 1:28 PM

It's great to see your work on Visual Studio extension integration via VSIX. I'm happy to try out your change. I have a few questions:

  1. How am I supposed to try this out? Given that actually building a VSIX installer isn't part of this change, what should I do?
  2. Have you looked into scripting the VSIX creation? (Yes, I work at Microsoft, but I too am doing compiler development, not working on installers etc.)
dtarditi abandoned this revision.Jul 23 2018, 5:38 PM

This is not needed after was committed. The approach there of using a VSIX package is better than the script-based approach here.