MantisBT - CMake
View Issue Details
0014458CMakeCMakepublic2013-10-04 04:572014-06-02 08:37
hansw 
Brad King 
normalminorN/A
closedfixed 
 
CMake 3.0CMake 3.0 
0014458: Support clang-cl, clang's cl-compatible driver
Clang has recently developed a cl-compatible driver, clang-cl.

Configuring a project on Windows with cmake -DCMAKE_CXX_COMPILER=clang-cl still generates files that try to use the regular gcc-compatible clang options.

Would it be possible to teach cmake about this new driver mode?
clang-cl was announced at http://blog.llvm.org/2013/09/a-path-forward-for-llvm-toolchain-on.html, [^] and builds are available from http://llvm.org/builds/ [^]
No tags attached.
related to 0013035closed Brad King Support for MinGW Clang on Windows 
has duplicate 0014586closed  LLVM platform toolset for Visual Studio 
Issue History
2013-10-04 04:57hanswNew Issue
2013-10-04 09:21Brad KingRelationship addedrelated to 0013035
2013-10-04 13:56Brad KingAssigned To => Brad King
2013-10-04 13:56Brad KingStatusnew => assigned
2013-10-04 13:56Brad KingTarget Version => CMake 3.0
2013-10-04 13:57Brad KingNote Added: 0033974
2013-10-04 13:58Brad KingNote Added: 0033976
2013-10-04 14:01Brad KingNote Added: 0033977
2013-10-04 14:04hanswNote Added: 0033978
2013-10-07 17:29hanswNote Added: 0034073
2013-10-08 11:20Brad KingNote Added: 0034074
2013-10-08 11:20Brad KingStatusassigned => resolved
2013-10-08 11:20Brad KingResolutionopen => fixed
2013-10-08 11:20Brad KingFixed in Version => CMake 3.0
2013-11-20 08:35Brad KingRelationship addedhas duplicate 0014586
2014-06-02 08:37Robert MaynardNote Added: 0036017
2014-06-02 08:37Robert MaynardStatusresolved => closed

Notes
(0033974)
Brad King   
2013-10-04 13:57   
Okay, I've installed both Clang for MinGW (see issue 0013035) and Clang CL and got things working. First I had to introduce the notion of one compiler simulating another, used to detect the difference between the GNU-like and MS-like Clang:

 CMakeDetermineCompilerId: Add notion of "simulated" id/version
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=51ab85c3 [^]

Then I added the platform files to use this information to load either GNU or MSVC flags:

 Clang: Support Windows variants for GNU and MSVC
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3d8356d4 [^]
(0033976)
Brad King   
2013-10-04 13:58   
Please try out CMake from Git commit 3d8356d4.
(0033977)
Brad King   
2013-10-04 14:01   
FYI, you can even use the VS generator with the LLVM toolset like this:

 cmake ../src -G "Visual Studio 10" -T LLVM-vs2010

or

 cmake ../src -G "Visual Studio 11" -T LLVM-vs2012
(0033978)
hansw   
2013-10-04 14:04   
Thanks! I'll try it out as soon as I can.
(0034073)
hansw   
2013-10-07 17:29   
I tried this out with CMake from http://www.cmake.org/files/dev/cmake-2.8.11.20131006-gd5ad0-win32-x86.zip [^] and it seems to work great. Thanks!
(0034074)
Brad King   
2013-10-08 11:20   
Thanks for testing. The change is now in master.
(0036017)
Robert Maynard   
2014-06-02 08:37   
Closing resolved issues that have not been updated in more than 4 months.