I would like to check specific compiler settings during compilation. I’m talking about settings set in xCode and used by the compiler.
for example, i would like to check this setting and conditionally compile code
#if GCC_OPTIMIZATION_LEVEL == 0
NSLog(@"No Optimization");
#else
NSLog(@"Optimization enabled");
#endif
The above code does not work, does anyone know how to do this ?
There is:
Which appears to be set whenever
-Ois set with a level above0. If-O0is used then this constant is not set.This was found using:
and:
under Linux.