I had envisaged one of these in the project preferences
TESTING
= HOST
TESTING
= TARGET
And note that you can do this:
#ifndef TESTING
...
#elif TESTING == HOST
...
#elif TESTING == TARGET
...
#else
#error "Unexpected value of TESTING."
#endif
Also:
#if defined(TESTING) && TESTING == HOST
...
#endif
If you want to collapse the tests. The parenthesis are optional (#if defined TESTING
is valid) but I think it's clearer to include them, especially when you start adding additional logic.