mirror of
https://github.com/ZDoom/zdoom-macos-deps.git
synced 2024-11-22 20:11:51 +00:00
aedi: add sdk_version()
method to build state
This commit is contained in:
parent
e3289f88ba
commit
0ec387c33e
2 changed files with 10 additions and 4 deletions
|
@ -18,6 +18,7 @@
|
||||||
|
|
||||||
import hashlib
|
import hashlib
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import typing
|
import typing
|
||||||
|
@ -69,6 +70,13 @@ class BuildState:
|
||||||
def sdk_path(self) -> Path:
|
def sdk_path(self) -> Path:
|
||||||
return self.platform.sdk_path if self.platform else None
|
return self.platform.sdk_path if self.platform else None
|
||||||
|
|
||||||
|
def sdk_version(self) -> typing.Union[StrictVersion, None]:
|
||||||
|
if sdk_path := self.sdk_path():
|
||||||
|
if match := re.search(r'/MacOSX(\d+.\d+).sdk', str(sdk_path), re.IGNORECASE):
|
||||||
|
return StrictVersion(match[1])
|
||||||
|
|
||||||
|
return None
|
||||||
|
|
||||||
def c_compiler(self) -> Path:
|
def c_compiler(self) -> Path:
|
||||||
return self.platform.c_compiler if self.platform else None
|
return self.platform.c_compiler if self.platform else None
|
||||||
|
|
||||||
|
|
|
@ -82,10 +82,8 @@ class BuildTarget(Target):
|
||||||
if os_version and os_version < self.os_version[state.architecture()]:
|
if os_version and os_version < self.os_version[state.architecture()]:
|
||||||
raise RuntimeError('Minimum OS version requirement is not met')
|
raise RuntimeError('Minimum OS version requirement is not met')
|
||||||
|
|
||||||
sdk_path = state.sdk_path()
|
if sdk_version := state.sdk_version():
|
||||||
if sdk_path:
|
if sdk_version < self.sdk_version[state.architecture()]:
|
||||||
match = re.search(r'/MacOSX(\d+.\d+).sdk', str(sdk_path), re.IGNORECASE)
|
|
||||||
if match and StrictVersion(match[1]) < self.sdk_version[state.architecture()]:
|
|
||||||
raise RuntimeError('Minimum SDK version requirement is not met')
|
raise RuntimeError('Minimum SDK version requirement is not met')
|
||||||
|
|
||||||
os.makedirs(state.build_path, exist_ok=True)
|
os.makedirs(state.build_path, exist_ok=True)
|
||||||
|
|
Loading…
Reference in a new issue