How do you add custom flags when using UBT via RunUAT.bat?
I’m doing this specifically for Linux builds and trying to follow the pattern used by EnableAddressSanitizer.
UEBuildLinux.cs
/// <summary>
/// Enables my custom flag
// </summary>
[CommandLine("-MyCustomFlag")]
[XmlConfigFile(Category = "BuildConfiguration", Name = "bMyCustomFlag")]
public bool bMyCustomFlag = false;
LinuxToolchain.cs
enum LinuxToolChainOptions
{
...
/// <summary>
/// Enable some compiler flag
/// </summary>
MyCustomFlag = 0x8,
}
…
protected virtual string GetCLArguments_Global(CppCompileEnvironment CompileEnvironment)
// MyCustomFlag
if (Options.HasFlag(LinuxToolChainOptions.MyCustomFlag))
{
Result += " -f-some-linux-compiler-flag";
}
When I call RunUAT.bat with -MyCustomFlag=true
or -MyCustomFlag
that flag is never set, it’s always false.
What am I doing wrong?