[3.2] Add iOS SDK version check.

This commit is contained in:
bruvzg 2020-10-06 11:23:20 +03:00
parent b2897f1f7b
commit d44bc8d5bc
No known key found for this signature in database
GPG key ID: FCED35F1CECE0D3A
2 changed files with 22 additions and 1 deletions

View file

@ -702,6 +702,24 @@ def CommandNoCache(env, target, sources, command, **args):
return result
def get_darwin_sdk_version(platform):
sdk_name = ""
if platform == "osx":
sdk_name = "macosx"
elif platform == "iphone":
sdk_name = "iphoneos"
elif platform == "iphonesimulator":
sdk_name = "iphonesimulator"
else:
raise Exception("Invalid platform argument passed to get_darwin_sdk_version")
try:
return float(decode_utf8(subprocess.check_output(["xcrun", "--sdk", sdk_name, "--show-sdk-version"]).strip()))
except (subprocess.CalledProcessError, OSError):
print("Failed to find SDK version while running xcrun --sdk {} --show-sdk-version.".format(sdk_name))
raise
def detect_darwin_sdk_path(platform, env):
sdk_name = ""
if platform == "osx":

View file

@ -1,6 +1,6 @@
import os
import sys
from methods import detect_darwin_sdk_path
from methods import detect_darwin_sdk_path, get_darwin_sdk_version
def is_active():
@ -14,6 +14,9 @@ def get_name():
def can_build():
if sys.platform == "darwin" or ("OSXCROSS_IOS" in os.environ):
if get_darwin_sdk_version("iphone") < 13.0:
print("Detected iOS SDK version older than 13")
return False
return True
return False