For Makefile-based projects:

For Visual Studio projects:

For instance, the following screenshot shows a Makefile with a new target for C++test-specific flags: