BuildPipeline.BuildPlayer() - enable / disable burst compilation from script

We’re using a -batchmode -nographics build machine, and running a custom -executeMethod to invoke BuildPipeline.BuildPlayer(). We’d like to enable/disable burst for different custom build configurations.

Is there any way to set the Jobs → Burst → Enable Compilation & Show Timings settings from script?

If there’s no official API is there some temporary workaround for using reflection to pull it out of the editor settings? Hacks welcome, we need a working solution even if it’s only temporary!

(opening the editor on the build machine is not an option)

Those are actually editor settings. They can be set with BurstEditorOptions (BurstEditorOptions.
EnableBurstCompilation = false; etc)

But for building what you want is actually under Edit → Project Settings → Burst AOT Settings and you can set them per platform.

Check out BurstAotSettings.cs
It’s all internal though so you’ll probably need reflection.

1 Like

Excellent, that’s just what I was looking for. I was digging through the DLLs with ILSpy and didn’t look in the package cache. Thanks!