Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


CompileTarget

Specifies whether code should be Burst compiled for the player, editor, or both.
Read time 1 minuteLast updated 12 days ago

Definition

public GenerateTestsForBurstCompatibilityAttribute.BurstCompatibleCompileTarget CompileTarget

Remarks

When set to BurstCompatibleCompileTarget.Editor, the generated Burst compatibility code will be surrounded by #if UNITY_EDITOR to ensure that the Burst compatibility test will only be executed in the editor. The code will be compiled with Burst function pointers. If you have a non-null RequiredUnityDefine, an #if with the RequiredUnityDefine will also be emitted.
When set to BurstCompatibilityCompileTarget.Player, the generated Burst compatibility code will only be surrounded by an #if containing the RequiredUnityDefine (or nothing if RequiredUnityDefine is null). Instead of compiling with Burst function pointers, a player build is started where the Burst AOT compiler will verify the Burst compatibility. This is done to speed up Burst compilation for the compatibility tests since Burst function pointer compilation is not done in parallel.
When set to BurstCompatibilityCompileTarget.PlayerAndEditor, the generated Burst compatibility code will only be surrounded by an #if containing the RequiredUnityDefine (or nothing if RequiredUnityDefine is null). The code will be compiled both by the editor (using Burst function pointers) and with a player build (using Burst AOT).
For best performance of the Burst compatibility tests, prefer to use BurstCompatibilityCompileTarget.Player as much as possible.