Custom command-line paramaters and #defines

I would like to pass custom parameters to the Unreal Build Tool that end up becoming #defines that I can use in my code to strip out certain features.

I heard this is possible by reading them in Target.cs and then passing them on to Build.cs but I can’t work out how to do it. Does anyone have any ideas?