Download

How to add Global Preprocessor Defines through the Automation Tool

Hey,

This was a problem that I see get asked in UDN and the Community Answer Hub. I needed this for a project I worked on and took a bit of time looking into how to be able to add C++ preprocessor defines through the UAT. This is handy if you wanted to do different builds through some automated build agent with different defines in the code;

I made a pull request on the UE4 github repository, so until that gets looked at by someone from the UE4 staff, everyone can take a look at what I implemented and copy the changes into whatever version of the engine they are using.

https://github.com/EpicGames/UnrealEngine/pull/5285

I tested with a couple of projects I had with varying complexity and it works quite well, though as I am relatively inexperienced with UE4’s build process I’d be worried if I missed out on some edge cases.