In C/C++/Objective C you can define a macro using compiler preprocessors. Moreover, you can include/exclude some parts of code using compiler preprocessors.
My two cents for Xcode 8:
a) A custom flag using the -D prefix works fine, but...
-D
b) Simpler use:
In Xcode 8 there is a new section: "Active Compilation Conditions", already with two rows, for debug and release.
Simply add your define WITHOUT -D.