[cfe-dev] Detecting MSVC version and location used by Clang

Boris Kolpackov via cfe-dev cfe-dev at lists.llvm.org
Mon Dec 11 22:35:38 PST 2017

No, nobody has any thoughts on this?

----- Original Message -----
From: "Boris Kolpackov" <boris at codesynthesis.com>
Subject: Detecting MSVC version and location used by Clang
Date: Wed, 06 Dec, 2017 11:27 +0200


1. Include MSVC version in the target triplet reported by -dumpmachine.

2. Include MSVC and Platform SDK bin/ directories in the 'programs' value
   reported by -print-search-dirs.

Long version:

We are working[1] on adding "Clang-targeting-MSVC" support to build2 and
the problem we ran into is determining (1) which MSVC version Clang is
targeting and (2) the location of the MSVC toolchain.

For (1) the natural place to discover this would be the -dumpmachine
output. I see that internally Clang includes the compiler version:

clang++.exe -cc1 -triple x86_64-pc-windows-msvc19.11.25547 [...]

However, the version is omitted from the -dumpmachine output:

clang++.exe -dumpmachine

Would it be possible to preserve the version here?

For (2), we need to find the bin/ directories of MSVC itself (for
lib.exe and link.exe) as well as of Platform SDK (for rc.exe,
mt.exe, etc).

Again, the natural place to include these paths would be the
'programs' value in -print-search-dirs output. Currently it looks
like this:

programs: =C:\LLVM\build\bin
libraries: =C:\LLVM\build\lib\clang\6.0.0

[1] https://lists.build2.org/archives/users/2017-December/000139.html


More information about the cfe-dev mailing list