I would like to ask how can I exclude debug code like GEngine->AddOnScreenDebugMessage() during shipping. I use this kind of debug messages in my project, however I would like to be sure that these will not be displayed in shipped buiild. I prefer some macros because generated code will be cleaner and will not contain conditions and code that will never run.
Thank you
(I wanted to post this to AnswerHub however I get internal error 3 times)
It is strange but I am not able to get it work. It looks like UE_BUILD_DEBUG is not used in any configuration. I use downloaded binary version and available build configurations are:
DebugGame
DebugGame Editor
Development
Development Editor
Shipping
This will cause compilation errors. Use #if UE_BUILD_DEBUG instead. The reason is that #ifdef returns true for #define UE_BUILD_DEBUG 0, since it is defined, just to the value zero.
In general, at Epic we use #if !UE_BUILD_SHIPPING (not shipping).