www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Is it possible? branching on debug info

reply Guillaume Piolat <first.last spam.org> writes:
I'd like to have:


         version (D_DebugInfo)
         {}
         else
         {
             version = enableFeatureThatIsAnnoyingWhenDebugging;
         }


Is there a way to know if debug info is being emitted when 
compiling?
"debug is not cutting it because sometimes you really need to 
debug with or without -debug, and with or without -O. I want -g.
Oct 16 2022
parent rikki cattermole <rikki cattermole.co.nz> writes:
There is: D_Optimized

https://dlang.org/spec/version.html#predefined-versions

But nothing for debug info.

I'm afraid I think you'll just have to use a version (unless you want to 
add it).
Oct 16 2022