MantisBT - CMake
View Issue Details
0010693CMakeCMakepublic2010-05-09 11:412012-08-15 09:34
Modestas Vainius 
Brad King 
normalfeatureN/A
closedfixed 
amd64Debian GNU/Linuxsid
CMake-2-8 
 
0010693: Support detection of CLang compiler
Pasted from original report at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=560693 [^] :

Cmake currently reports Clang compiler as GCC (what is not that bad as
they are in most cases compatible), however it would be great if it
would also provide way to distinguish these two compiler without
introducing this check in every CMakeLists.txt where it is needed.

The compiler can be detected by looking for __clang__ define, what
should be done before probing for GCC, because Clang defines most
symbols GCC does.
Read full Debian bug log for a bit more information.
No tags attached.
related to 0013473closed Brad King ASM compiler identification for Clang missing 
patch 0001-Recognize-CLang-C-and-C-compilers.patch (2,688) 2010-05-11 13:54
https://public.kitware.com/Bug/file/3105/0001-Recognize-CLang-C-and-C-compilers.patch
Issue History
2010-05-09 11:41Modestas VainiusNew Issue
2010-05-10 15:47Bill HoffmanStatusnew => assigned
2010-05-10 15:47Bill HoffmanAssigned To => Brad King
2010-05-11 13:54Brad KingFile Added: 0001-Recognize-CLang-C-and-C-compilers.patch
2010-05-11 13:55Brad KingNote Added: 0020713
2010-05-11 15:57Modestas VainiusNote Added: 0020714
2010-05-17 17:37Modestas VainiusNote Added: 0020769
2010-05-17 17:55Brad KingNote Added: 0020770
2011-10-06 15:42rubenvbNote Added: 0027545
2011-10-06 16:22Brad KingNote Added: 0027546
2011-10-06 16:22Brad KingStatusassigned => resolved
2011-10-06 16:22Brad KingResolutionopen => fixed
2012-03-06 08:37David ColeNote Added: 0028821
2012-03-06 08:37David ColeStatusresolved => closed
2012-08-15 09:34Brad KingRelationship addedrelated to 0013473

Notes
(0020713)
Brad King   
2010-05-11 13:55   
Please relay the attached patch to the original reporter for testing.
(0020714)
Modestas Vainius   
2010-05-11 15:57   
Done. Will get back to you once reporter replies.
(0020769)
Modestas Vainius   
2010-05-17 17:37   
Reporter confirmed that the patch was fine:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=560693#31 [^]
(0020770)
Brad King   
2010-05-17 17:55   
I've published a slightly modified version ("Clang" rather than "CLang") to our 'next' branch:

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=571dc748 [^]
(0027545)
rubenvb   
2011-10-06 15:42   
This problem is present in another form on Windows. On Windows you can build Clang as a MinGW/GCC replacement or in conjunction with MSVC. Currently CMake thinks Clang == MSVC, even when specifying -G"MinGW Makefiles" and produces .obj files and tries to link to .lib files.

I believe Clang differentiates MSVC/GCC compatibility through it's triple:
*-*-mingw32 is GCC-like (.a and .o files)
*-*-win32 is MSVC-like (.lib and .obj files)

I cannot build Clang with (MinGW)Clang with CMake because of this, which is a pity...
(0027546)
Brad King   
2011-10-06 16:22   
CMake has supported Clang for a while. The original issue is resolved.

Re 0010693:0027545: Please open a new issue for Clang on MinGW. Thanks.
(0028821)
David Cole   
2012-03-06 08:37   
Closing resolved issues that have not been updated in more than 4 months.