Option to make UnrealBuildTool log all commands, eg. full compiler command lines

I’m trying to figure out a build error on Linux.

I want to see the actual command line that is passed to clang (and ld). Echo all commands invoked by UBT to some log so I can trace where it’s going wrong.

Is there an option for this?

(-verbose doesn’t give me anything useful)

Also is there a way to add options to the compiler/linker command lines? In particular I want to add --verbose to ld.

I’m a plugin developer trying to work on my build command line. I need to see the full command line being executed by the system to see where the errors are.

What I want to see is something like :

/usr/bin/g++ -fno-rtti -c -x none -Wall -fPIC -Wno-comment -Wno-unused-function
-Wno-unused-parameter -Wno-unused-variable -Wno-unused-result -Wno-extra -Wno-m
ultichar -Wno-unused-label -Wno-unused-but-set-variable -Wno-unused-local-typede
fs -Wno-unused-value -fno-stack-protector -ffast-math -finline -fno-exceptions […]

it’s extremely hard and frustrating trying to figure out build issues when I can’t see the command lines that are actually being invoked to check if the changes that I think I’m making are actually happening the way I intend when I modify my build.cs rules.

Hi charlesatrad,

What exactly is your build error? You should only need to look into the commands UBT is using if you believe that there is a bug in the build system.

Hi charlesatrad,

The only way to enable verbose output would be to set both bVerboseCompiler and bVerboseLinker to true on the passed in SDK in the Linux toolchain’s constructor in LinuxToolChain.cs in UBT’s source.

If that still does not do what you want, then you could try logging out the returned values from LinuxToolChain::GetLinkArguments and LinuxToolChain::GetCLArguments_Global.

Thanks that helps.

At what point of the process are the arguments all done being processed? That is, where should I call GetLinkArguments and GetCLArguments_Global such that I can get them as they were passed to the shell?

Hi charlesatrad,

You could just find where those calls are invoked inside of LinuxToolChain.cs. If they’re not called inside of that script directly, then you could try just printing out the compounded Result string before it is returned from those two functions.