From 3d44ed93d31b03b923317301e2e510dd3abf53ee Mon Sep 17 00:00:00 2001 From: Chris Phlipot Date: Tue, 10 Oct 2023 17:48:07 -0700 Subject: [PATCH] install-build-deps: Add options to override autodetected platform Add some options to allow overridin which platform dependencies are downloaded for. This makes it easier to: - Workaround incorrect autodetection - sanity check install-build-deps on different platforms - Test x64 on Arm-based macs Change-Id: If7b2be68c22ea2bca0d66770a89d877b3c76be38 --- tools/install-build-deps | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/install-build-deps b/tools/install-build-deps index de0f53ce3f..c3822f60c0 100755 --- a/tools/install-build-deps +++ b/tools/install-build-deps @@ -649,12 +649,22 @@ def Main(): parser.add_argument('--verify', help='Check all URLs', action='store_true') parser.add_argument( '--no-toolchain', help='Do not download toolchain', action='store_true') + parser.add_argument( + '--build-os', + default=system().lower(), + choices=['windows', 'darwin', 'linux'], + help='Override the autodetected build operating system') + parser.add_argument( + '--build-arch', + default=GetArch(), + choices=['arm64', 'x64'], + help='Override the autodetected build CPU architecture') args = parser.parse_args() if args.verify: CheckHashes() return 0 - target_os = system().lower() + target_os = args.build_os if args.ui and target_os == 'windows': print('Building the UI on Windows is unsupported') return 1 @@ -680,7 +690,7 @@ def Main(): RmtreeIfExists(os.path.join(ROOT_DIR, old_dir)) for dep in deps: - target_arch = GetArch() + target_arch = args.build_arch matches_os = dep.target_os == 'all' or target_os == dep.target_os matches_arch = dep.target_arch == 'all' or target_arch == dep.target_arch if not matches_os or not matches_arch: