I can not figure out, why this happens. When I save the project, magically DEBUG=1 and _DEBUG=1 is added to the preprocessor defines of both the Debug AND Release configurations of the Xcode MacOS project, although they are not defined in Projucer.
I figured it out myself. There is a checkbox in the Release configuration for enabling Debugging. This probably causes the defines to be made. What I really wanted when I check this, was symbol files. The Release configuration should have DWARF+DSYM set, so that you have symbols for your release build, but they are external to the binary. The same is true for Windows, where I do want PDB file for the release build. These symbol files are needed to match addresses to symbols, when you got crash dumps from testers or users.
The way it is right now, each time I save the project in Projucer, I have to correct these settings.
@wkundrus in Projucer, you can define “Custom Xcode flags” per configuration. Put
DEBUG_INFORMATION_FORMAT=dwarf-with-dsym there, that should do what you want.
Yes, that did it. Thanks !
Unfortunately, Projucer ignores these flags when it defines the same flag with a different value. In this case, it i GCC_GENERATE_DEBUGGING_SYMBOLS, which it sets to NO for release builds. If I add that in custom flags with the value YES, Projucer still sets it NO.
GCC_GENERATE_DEBUGGING_SYMBOLS = TRUE in the “Custom Xcode flags” field of the Release configuration of the HelloWorld project:
And that changed the setting in Xcode as expected:
Try to add several custom flags separated by semicolon
Flags should be separated by commas, not semicolons.