View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0010693CMakeCMakepublic2010-05-09 11:412012-08-15 09:34
ReporterModestas Vainius 
Assigned ToBrad King 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusclosedResolutionfixed 
Platformamd64OSDebian GNU/LinuxOS Versionsid
Product VersionCMake-2-8 
Target VersionFixed in Version 
Summary0010693: Support detection of CLang compiler
DescriptionPasted 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.
Additional InformationRead full Debian bug log for a bit more information.
TagsNo tags attached.
Attached Filespatch file icon 0001-Recognize-CLang-C-and-C-compilers.patch [^] (2,688 bytes) 2010-05-11 13:54 [Show Content]

 Relationships
related to 0013473closedBrad King ASM compiler identification for Clang missing 

  Notes
(0020713)
Brad King (manager)
2010-05-11 13:55

Please relay the attached patch to the original reporter for testing.
(0020714)
Modestas Vainius (reporter)
2010-05-11 15:57

Done. Will get back to you once reporter replies.
(0020769)
Modestas Vainius (reporter)
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 (manager)
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 (reporter)
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 (manager)
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 (manager)
2012-03-06 08:37

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2010-05-09 11:41 Modestas Vainius New Issue
2010-05-10 15:47 Bill Hoffman Status new => assigned
2010-05-10 15:47 Bill Hoffman Assigned To => Brad King
2010-05-11 13:54 Brad King File Added: 0001-Recognize-CLang-C-and-C-compilers.patch
2010-05-11 13:55 Brad King Note Added: 0020713
2010-05-11 15:57 Modestas Vainius Note Added: 0020714
2010-05-17 17:37 Modestas Vainius Note Added: 0020769
2010-05-17 17:55 Brad King Note Added: 0020770
2011-10-06 15:42 rubenvb Note Added: 0027545
2011-10-06 16:22 Brad King Note Added: 0027546
2011-10-06 16:22 Brad King Status assigned => resolved
2011-10-06 16:22 Brad King Resolution open => fixed
2012-03-06 08:37 David Cole Note Added: 0028821
2012-03-06 08:37 David Cole Status resolved => closed
2012-08-15 09:34 Brad King Relationship added related to 0013473


Copyright © 2000 - 2018 MantisBT Team