It would be useful for macOS too.
C compilers for macOS support env var MACOSX_DEPLOYMENT_TARGET
(AKA -mmacosx-version-min
) that is in the form of "10.x" or "10.x.y". It affects availability of system APIs, opts-in to new API behaviors, and makes the linker use new executable formats not compatible with older systems.
Currently core-foundation-sys uses Cargo features to select deployment target, which can be out of sync with the actual target, and it's a bit clumsy compared to Apple's convention: