build: fix clang format location helper (#42527)
This commit is contained in:
parent
1a4d58a9fb
commit
b35adaee2d
1 changed files with 11 additions and 7 deletions
|
@ -4,6 +4,7 @@ import contextlib
|
||||||
import errno
|
import errno
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
import platform
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
@ -184,13 +185,16 @@ def get_electron_exec():
|
||||||
|
|
||||||
def get_buildtools_executable(name):
|
def get_buildtools_executable(name):
|
||||||
buildtools = os.path.realpath(os.path.join(ELECTRON_DIR, '..', 'buildtools'))
|
buildtools = os.path.realpath(os.path.join(ELECTRON_DIR, '..', 'buildtools'))
|
||||||
chromium_platform = {
|
|
||||||
'darwin': 'mac',
|
if sys.platform == 'darwin':
|
||||||
'linux': 'linux64',
|
chromium_platform = 'mac_arm64' if platform.machine() == 'arm64' else 'mac'
|
||||||
'linux2': 'linux64',
|
elif sys.platform in ['win32', 'cygwin']:
|
||||||
'win32': 'win',
|
chromium_platform = 'win'
|
||||||
'cygwin': 'win',
|
elif sys.platform in ['linux', 'linux2']:
|
||||||
}[sys.platform]
|
chromium_platform = 'linux64'
|
||||||
|
else:
|
||||||
|
raise Exception(f"Unsupported platform: {sys.platform}")
|
||||||
|
|
||||||
if name == 'clang-format':
|
if name == 'clang-format':
|
||||||
path = os.path.join(buildtools, chromium_platform, 'format', name)
|
path = os.path.join(buildtools, chromium_platform, 'format', name)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue