Page MenuHomePhabricator

[Darwin] Add lit features for comparison against target OS version.
Needs ReviewPublic

Authored by delcypher on Nov 12 2019, 5:32 PM.

Details

Reviewers
yln
kubamracek
Summary

The patch adds lit features that can be used to make tests
only supported if the target OS is new enough. Example:

REQUIRES: apple_osx_geq_10_15_0 || apple_ios_geq_13_0_0 || \
          apple_watchos_geq_6_0_0 || apple_tvos_geq_13_0_0

Or if the target OS is sufficiently old. Example:

REQUIRES: apple_osx_lt_10_15_0 || apple_ios_lt_13_0_0 || \
          apple_watchos_lt_6_0_0 || apple_tvos_lt_13_0_0

The implementation includes greater-than (gt) and less-than-or-equal-to
(`leq) feature variants too for completeness.

This implementation does not add features exhaustively. Instead the
implementation requires specific (i.e. important) OS versions to be
explicitly stated. This patch just adds macOS 10.15.0 and the aligned
OS versions. We can easily add other OS versions in the future if they
become important.

rdar://problem/57127970