[Cmake] File and compiler specific flags?
Amitha Perera
perera at cs.rpi.edu
Fri Aug 17 17:23:19 EDT 2001
Is there a clean way to specify compile flags that depend on the
compiler and on the file? For example, with gcc, xcv_geometry.cxx
needs -ftemplate-depth-100.
I noticed that there is now a variable CMAKE_COMPILER_IS_GNUCXX. Does
it make sense to extend on this, and have many such variables
(IS_SUNWORKSHOP, IS_MIPSPRO, IS_GNUCXX_30, ...) ? Something like this,
combined with a command ADD_FLAGS( [target] flags ) would solve the
problem above.
For this particular problem, of course, I could put
-ftemplate-depth-100 into the "global" compiler options. There are
other occasions, though, where this is not feasible. For example, some
files cannot be compiled with optimisation turn on because the
compiler produces incorrect code.
Thanks,
Amitha.
More information about the CMake
mailing list