aedi: add target's ability to validate minimum sdk versions

This commit is contained in:
alexey.lysiuk 2021-06-28 10:51:47 +03:00
parent 0a447b3077
commit 62b6b34b6e

View file

@ -69,11 +69,21 @@ class BuildTarget(Target):
self.os_version['x86_64'] = OS_VERSION_X86_64
self.os_version['arm64'] = OS_VERSION_ARM64
self.sdk_version = dict()
self.sdk_version['x86_64'] = OS_VERSION_X86_64
self.sdk_version['arm64'] = OS_VERSION_ARM64
def configure(self, state: BuildState):
os_version = state.os_version()
if os_version and os_version < self.os_version[state.architecture()]:
raise RuntimeError('Minimum OS version requirement is not met')
sdk_path = state.sdk_path()
if sdk_path:
match = re.search(r'/MacOSX(\d+.\d+).sdk', sdk_path, re.IGNORECASE)
if match and StrictVersion(match[1]) < self.sdk_version[state.architecture()]:
raise RuntimeError('Minimum SDK version requirement is not met')
os.makedirs(state.build_path, exist_ok=True)
env = self.environment