[cfe-dev] Distinguishing between clang Window versions

Edward Diener eldlistmailingz at tropicsoft.com
Wed Jul 9 15:01:18 PDT 2014


On 7/9/2014 2:40 PM, Reid Kleckner wrote:
> On Wed, Jul 9, 2014 at 7:09 AM, Edward Diener
> <eldlistmailingz at tropicsoft.com
> <mailto:eldlistmailingz at tropicsoft.com>> wrote:
>
>     I see where a build of clang on Windows using VC++ produces both
>     clang.exe and clang-cl.exe and that they are both the same
>     executables. Nonetheless depending on the -target ( or default
>     -target ) passed to the clang driver we have different build
>     expectations in Boost Build. In Windows When the target mode is VC++
>     clang emulates VC++ in various ways and when the target mode is
>     mingw/gcc clang emulates mingw/gcc. Even with the latter on Windows
>     there are a few subtle differences from clang on Linux. That is why
>     Boost Build needs to treat them differently from within its .jam files.
>
>
> What kinds of properties of a compiler do you normally check in Boost
> Build?  If you're willing to do a test compile, you can look for '#if
> defined(__clang__) && defined(_MSC_VER)' or '#if defined(__clang__) &&
> defined(__GNUC__)'.

That is another possibility which I will bring up in Boost Build.

Essentially we need to find out as easily as possible whether a clang 
executable on Windows targets vc++ or gcc/mingw, while also taking into 
account the -target option on the command line.

BTW I could not find in the latest clang 3.5 documentation any mention 
of the -target option. Likewise, and I am sure you have heard it before, 
an alphabetical list of all clang options in the documentation, with 
explanations for each one, would be greatly appreciated.




More information about the cfe-dev mailing list