aedi: fix setting minimum os version via command line

this resolves the following error after switching from distutils to packaging module
TypeError: '>=' not supported between instances of 'str' and 'Version'
This commit is contained in:
alexey.lysiuk 2023-12-23 10:29:02 +02:00
parent 89b9778fd1
commit aef9b58f4a

View file

@ -24,6 +24,7 @@ import typing
from pathlib import Path
from platform import machine
from .packaging.version import Version
from .state import BuildState
from .target import targets
from .target.base import Target
@ -111,14 +112,14 @@ class Builder(object):
return sdk_probe_path if sdk_probe_path.exists() else None
if not arguments.disable_x64:
os_version = arguments.os_version_x64 if arguments.os_version_x64 else OS_VERSION_X86_64
os_version = Version(arguments.os_version_x64) if arguments.os_version_x64 else OS_VERSION_X86_64
assert os_version >= OS_VERSION_X86_64, f'macOS {os_version} is not supported'
sdk_path = adjust_sdk_path(arguments.sdk_path_x64)
platform = TargetPlatform('x86_64', 'x86_64-apple-darwin', os_version, sdk_path, state.prefix_path)
self._platforms.append(platform)
if not arguments.disable_arm:
os_version = arguments.os_version_arm if arguments.os_version_arm else OS_VERSION_ARM64
os_version = Version(arguments.os_version_arm) if arguments.os_version_arm else OS_VERSION_ARM64
assert os_version >= OS_VERSION_ARM64, f'macOS {os_version} is not supported'
sdk_path = adjust_sdk_path(arguments.sdk_path_arm)
platform = TargetPlatform('arm64', 'aarch64-apple-darwin', os_version, sdk_path, state.prefix_path)