From 1b8cce4045c30e573626acf74714f3a682f54648 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Fri, 25 Dec 2020 13:28:47 +0200 Subject: [PATCH] build script: add argument to disable one platform --- build.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/build.py b/build.py index fc886efb..ec087251 100755 --- a/build.py +++ b/build.py @@ -1668,15 +1668,17 @@ class Builder(object): sdk_probe_path = f'{self.root_path}sdk{os.sep}MacOSX{os_version}.sdk' return sdk_probe_path if os.path.exists(sdk_probe_path) else None - os_version = arguments.os_version_x64 if arguments.os_version_x64 else '10.9' - sdk_path = adjust_sdk_path(arguments.sdk_path_x64) - platform = TargetPlatform('x86_64', 'x86_64-apple-darwin', os_version, sdk_path, self.prefix_path) - self._platforms.append(platform) + if not arguments.disable_x64: + os_version = arguments.os_version_x64 if arguments.os_version_x64 else '10.9' + sdk_path = adjust_sdk_path(arguments.sdk_path_x64) + platform = TargetPlatform('x86_64', 'x86_64-apple-darwin', os_version, sdk_path, self.prefix_path) + self._platforms.append(platform) - os_version = arguments.os_version_arm if arguments.os_version_arm else '11.0' - sdk_path = adjust_sdk_path(arguments.sdk_path_arm) - platform = TargetPlatform('arm64', 'aarch64-apple-darwin', os_version, sdk_path, self.prefix_path) - self._platforms.append(platform) + if not arguments.disable_arm: + os_version = arguments.os_version_arm if arguments.os_version_arm else '11.0' + sdk_path = adjust_sdk_path(arguments.sdk_path_arm) + platform = TargetPlatform('arm64', 'aarch64-apple-darwin', os_version, sdk_path, self.prefix_path) + self._platforms.append(platform) def run(self): self._create_prefix_directory() @@ -1923,6 +1925,10 @@ class Builder(object): group.add_argument('--verbose', action='store_true', help='enable verbose build output') group.add_argument('--jobs', help='number of parallel compilation jobs') + group = parser.add_mutually_exclusive_group() + group.add_argument('--disable-x64', action='store_true', help='disable x86_64 support') + group.add_argument('--disable-arm', action='store_true', help='disable ARM64 support') + return parser.parse_args(args) def checkout_git(self, url: str):