This is brilliant. You'd need to basically define every single compile-time param and then have your build process emit a customized binary (and retinue of supporting stuffs) that does just that and nothing else.
Probably makes your total build time significantly longer; you'd need aggressive caching based on the feature flag set.