How to make a conditional #pragma surface noforwardadd

Hi there,

I’d like to have this in my shader:

#if SHADER_API_MOBILE
#pragma surface surf Lambert noforwardadd
#else
#pragma surface surf Lambert
#endif

But this tries to compile both #pragma surface and ignores the second one instead of respecting the #if condition.

Anyone know how to add “noforwardadd” to a shader, but only when it’s compiled for mobile platforms?

Thanks!

Allen

The best answer I’ve found at this point is the following. It’s not perfect, since I believe this results in a larger shader, but it answers the question:

http://gamedev.stackexchange.com/a/123688/27387