How to set my project treat warning as error?

I want to set the warning level to /WX, how can I do that?

I’ve tried to add an argument “/WX” in UBT, but it would treat all warnings as errors including UE4 source code, I just want to treat my project warnings as errors.