[CMake] Enabling C99 in CMake

Owen Shepherd owen.shepherd at e43.eu
Fri Jun 24 10:16:22 EDT 2011


On 23/06/2011 23:32, "Todd Gamblin" <tgamblin at llnl.gov> wrote:
>You could do this, but it seems like a lot of work for the developer AND
>the user compared to my suggestion of just having a variable for the
>compiler-specific C99 flags, or some similar mechanism.  We know an awful
>lot of other things about compiler switches.  Dialect seems like a useful
>thing to add to the platform file.  Someone does this once for each known
>compiler ID and now no one has to bother with this stuff anymore.
>
>-Todd


A variable for the compiler-specific flags doesn't work in the case of
e.g. Sun Studio, where the C99 compiler and C89 compilers are separate
binaries.

I think the appropriate solution here is a project-specific dialect flag -
perhaps one taking options in the GNU format since it seems most familiar.
One could perhaps generalise this further - a file-specific dialect flag
which defaults to the value of the project-specific flag

-- Owen Shepherd
http://www.owenshepherd.net
owen.shepherd at e43.eu (general) / oshepherd1 at shef.ac.uk (academic)






More information about the CMake mailing list