You don't need an ifdef.
You just need a CLI option like java's --source, where you specify the source compatibility with different language versions.
You just need a CLI option like java's --source, where you specify the source compatibility with different language versions.