Say for instance I have a Visual Studio project with a configuration called "MyConfig" and I have the compilation symbol MY_CONFIG_SYMBOL
defined.
Is there a macro or command to see if MY_CONFIG_SYMBOL
is defined in the pre/post build events? Something like #if MY_CONFIG_SYMBOL
, but for the build event?
I finally found an answer. The following works perfectly:
if "$(DefineConstants.Contains('DEBUG'))" == "True" <command>
This works for any constants defined in the build, but note that the constant is case-sensitive ('DEBUG' != 'Debug').