Adding build option to detect if something is automatically registeres with serialization.

Fixing breakage from that code