We could add a feature detection to meson, then there would be just a single `ifdef`. Just as idea.
BTW, I am fine with this approach for the time being. If you don't have bandwidth to work on, I'll just create an issue so we don't forget it and work on it later.
Originally posted by @igaw in #2739 (comment)