I would recommend using the plusargs feature of SystemVerilog instead of a file of `define statements. This gives you complete flexibility at runtime while eliminating the need for you to recompile for every test.
You can create a pre-defined file of the plusargs and specify it on the simulation command line with the -f option.