@@ -773,7 +773,10 @@ def __init__(self, name: str, environment: 'Environment', kwargs: 'DependencyObj
773773 self .parse_modules (kwargs )
774774
775775 for_machine = MachineChoice .BUILD if kwargs .get ('native' , False ) else MachineChoice .HOST
776- if environment .machines [for_machine ].is_darwin () and self .check_macOS_recent_enough ():
776+ if (
777+ (environment .machines [for_machine ].system == 'darwin' and self .check_macOS_recent_enough ())
778+ or (environment .machines [for_machine ].system == 'ios' and self .check_iOS_recent_enough ())
779+ ):
777780 self .detect (kwargs )
778781
779782 def check_macOS_recent_enough (self ) -> bool :
@@ -787,6 +790,23 @@ def check_macOS_recent_enough(self) -> bool:
787790 sdk_version = subprocess .run (cmd , capture_output = True , check = True , encoding = 'utf-8' ).stdout .strip ()
788791 return mesonlib .version_compare (sdk_version , '>=13.3' )
789792
793+ def check_iOS_recent_enough (self ) -> bool :
794+ # platform.ios_ver() is only available since Python 3.13; use getattr
795+ # so this type-checks across Python versions.
796+ ios_ver = getattr (platform , 'ios_ver' , None )
797+ if ios_ver is None :
798+ return False
799+ ios_version = ios_ver ().system
800+ deploy_target = os .environ .get ('IPHONEOS_DEPLOYMENT_TARGET' , ios_version )
801+ if not mesonlib .version_compare (deploy_target , '>=16.4' ):
802+ return False
803+
804+ # We also need the SDK to be >=16.4
805+ sdk = "iphonesimulator" if ios_ver ().is_simulator else "iphoneos"
806+ cmd = ['xcrun' , '-sdk' , sdk , '--show-sdk-version' ]
807+ sdk_version = subprocess .run (cmd , capture_output = True , check = True , encoding = 'utf-8' ).stdout .strip ()
808+ return mesonlib .version_compare (sdk_version , '>=16.4' )
809+
790810 def detect (self , kwargs : 'DependencyObjectKWs' ) -> None :
791811 from .framework import ExtraFrameworkDependency
792812 dep = ExtraFrameworkDependency ('Accelerate' , self .env , kwargs )
0 commit comments