Skip to content

Commit

Permalink
install-build-deps: Add options to override autodetected platform
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Chris Phlipot committed Oct 11, 2023
1 parent c103536 commit 3d44ed9
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tools/install-build-deps
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit 3d44ed9

Please sign in to comment.