build: fix clang format location helper (#42530)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
parent
9fc0bfece2
commit
a9b0e73492
1 changed files with 11 additions and 7 deletions
|
@ -4,6 +4,7 @@ import contextlib
|
|||
import errno
|
||||
import json
|
||||
import os
|
||||
import platform
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
|
@ -184,13 +185,16 @@ def get_electron_exec():
|
|||
|
||||
def get_buildtools_executable(name):
|
||||
buildtools = os.path.realpath(os.path.join(ELECTRON_DIR, '..', 'buildtools'))
|
||||
chromium_platform = {
|
||||
'darwin': 'mac',
|
||||
'linux': 'linux64',
|
||||
'linux2': 'linux64',
|
||||
'win32': 'win',
|
||||
'cygwin': 'win',
|
||||
}[sys.platform]
|
||||
|
||||
if sys.platform == 'darwin':
|
||||
chromium_platform = 'mac_arm64' if platform.machine() == 'arm64' else 'mac'
|
||||
elif sys.platform in ['win32', 'cygwin']:
|
||||
chromium_platform = 'win'
|
||||
elif sys.platform in ['linux', 'linux2']:
|
||||
chromium_platform = 'linux64'
|
||||
else:
|
||||
raise Exception(f"Unsupported platform: {sys.platform}")
|
||||
|
||||
if name == 'clang-format':
|
||||
path = os.path.join(buildtools, chromium_platform, 'format', name)
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue