View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007045CMakeCMakepublic2008-05-18 23:572008-08-19 15:55
ReporterEric Wing 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake-2-6 
Target VersionFixed in Version 
Summary0007045: CMake compiles Obj-C (.m) files with g++ instead of gcc (Mac)
DescriptionI noticed that .m files are being compiled with g++ instead of gcc in non-C++ projects in the Makefile generator. The .m is for Objective-C, the .mm is for Objective-C++. In the former case, gcc should be used, not g++. This gives me linking problems in certain cases, presumably dealing with C++ name mangling, gcc incompatibility (such as linking stuff compiled with gcc 3.3 vs gcc 4.0), or stricter type checking.

Attached are two simple test programs, one with .m, the other with .mm.
With the Makefiles, gcc should be invoked in the .m test. g++ should be invoked (as it is now) with the .mm file.

The Xcode generator does the correct thing.

TagsNo tags attached.
Attached Filesgz file icon HelloObjC.tar.gz [^] (726 bytes) 2008-05-18 23:57

 Relationships

  Notes
(0013082)
Bill Hoffman (manager)
2008-08-19 15:55

cvs commit -m "BUG: fix for 7045, use gcc for .m" cmSystemTools.cxx
Committer: Bill Hoffman <bill.hoffman@kitware.com>
/cvsroot/CMake/CMake/Source/cmSystemTools.cxx,v <-- cmSystemTools.cxx
new revision: 1.384; previous revision: 1.383

 Issue History
Date Modified Username Field Change
2008-05-18 23:57 Eric Wing New Issue
2008-05-18 23:57 Eric Wing File Added: HelloObjC.tar.gz
2008-08-19 15:55 Bill Hoffman Status new => closed
2008-08-19 15:55 Bill Hoffman Note Added: 0013082
2008-08-19 15:55 Bill Hoffman Resolution open => fixed


Copyright © 2000 - 2018 MantisBT Team