How to use PreprocessingTool in Gradle?

You do it the same way you’re defining macros for the cppCompiler.

Here’s an example defining a macro for only shared libraries when building with MSVC: