From 62b6b34b6ebe660fcbda4a4abd4c17757ea4c709 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Mon, 28 Jun 2021 10:51:47 +0300 Subject: [PATCH] aedi: add target's ability to validate minimum sdk versions --- aedi/target/base.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/aedi/target/base.py b/aedi/target/base.py index b34d906d..0822fa9e 100644 --- a/aedi/target/base.py +++ b/aedi/target/base.py @@ -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