[CMake] Compiler flags for Obj-C++ files only

Alan W. Irwin irwin at beluga.phys.uvic.ca
Wed May 21 16:17:51 EDT 2008


On 2008-05-21 21:08+0200 Allan Odgaard wrote:

> I need to set a compiler flag for Obj-C++ files (-fobjc-call-cxx-cdtors).
>
> Setting it for C++ will give a warning from gcc when the source file type is 
> C++ (instead of Obj-C++).
>
> Is there any way to set flags for only Obj-C++ files?

Shouldn't Obj-C++ be treated as a separate language (analogous to gfortran 
or C++) in the GNU Compiler Collection?

If so, then the right way to approach this problem is to establish CMake
language support files for this distinct computer language.  To see what is
involved, look at the five files that support Fortran in the
cmake-2.6.0/Modules directory which have the names
CMakeDetermineFortranCompiler.cmake, CMakeFortranCompiler.cmake.in,
CMakeFortranCompilerId.F90.in, CMakeFortranInformation.cmake, and
CMakeTestFortranCompiler.cmake.

There are some additional Fortran support files for various platforms in the
Platform sub-directory of Modules.

N.B. I have used Fortran as an example here, but you can also see similar
language support files for other languages in the cmake-2.6.0/Modules
directory.

Some minimal (one sentence per file) documentation of the required CMake
language support files is given in the file
cmake-2.6.0/Modules/CMakeAddNewLanguage.txt.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the CMake mailing list