Nope. You can’t set render state, like the blend mode, via multi compiles. Those only work on things inside the CGPROGRAM / HLSLPROGRAM, and even then only things that aren’t other #pragma lines (at least until 2020.1).
What you can do is you can set the blend mode source and destination functions via material properties. For example see the configurable shader project for an example of that.
But that of course then requires the user to set the appropriate blend functions themselves. The solution to that is too use a custom material editor, like the built in Standard shaders use.
@bgolus A question about that:
To switch off blending, the Shaderlab syntax is
Blend Off
but when supplying the blend factors via material properties in that way, one has to specify two enum values (or four, if setting separate blend functions for color and alpha). The visually equivalent Blend setting to no blending at all of course is
Blend One Zero
Or
Blend One Zero, One Zero
But does setting this actually disable blending, or will this still incur the performance hit of blending? Of course it’s possible (and desirable) that the driver catches this - but does Unity already guarantee that in this case blending isn’t turned on at all?
Last I checked it seems like either Unity or possibly more likely the graphics API is smart enough to recognize either as being “no blend”, as when I check those kinds of materials in RenderDoc or Nvidia Nsight they show as having the blend disabled.