I added TEST=1 in the Preprocessor Macros section of the project target's Build Settings, and whenever I use it in code, the preprocessor thinks it's not defined.
- alt + click on it shows a question mark
- The syntax coloring doesn't work well
- The syntax autocomplete doesn't work well
For example, having:
#if TEST
// a
#else
// b
#endif
has this behavior:
- Syntax coloring only works for
// b - Syntax autocomplete only works for
// b
This is because the preprocessor can't find TEST (even if it's defined as 1, as I previously stated) so it treats it as being false.
Is there any way to solve these problems?
Edit:
My use case is related to multiple Project Targets. So, say that the initial target is named First, which has the TEST preprocessor macro defined with value 1.
If I create another project target named Second with no preprocessor macros defined and want to add some code for it only if TEST is 0 (false/not defined), I'll put it in the #else block (// b).
Knowing that syntax coloring and autocomplete works for // b, it looks like it works ok, but if I change the current target to the First one (pun intended) and even build it, it still works as Second is selected.


