[3.2] Add iOS SDK version check.
This commit is contained in:
parent
b2897f1f7b
commit
d44bc8d5bc
2 changed files with 22 additions and 1 deletions
18
methods.py
18
methods.py
|
@ -702,6 +702,24 @@ def CommandNoCache(env, target, sources, command, **args):
|
||||||
return result
|
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):
|
def detect_darwin_sdk_path(platform, env):
|
||||||
sdk_name = ""
|
sdk_name = ""
|
||||||
if platform == "osx":
|
if platform == "osx":
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
from methods import detect_darwin_sdk_path
|
from methods import detect_darwin_sdk_path, get_darwin_sdk_version
|
||||||
|
|
||||||
|
|
||||||
def is_active():
|
def is_active():
|
||||||
|
@ -14,6 +14,9 @@ def get_name():
|
||||||
def can_build():
|
def can_build():
|
||||||
|
|
||||||
if sys.platform == "darwin" or ("OSXCROSS_IOS" in os.environ):
|
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 True
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Reference in a new issue