[xb] Print clang-format version
This commit is contained in:
parent
a4412ad40d
commit
6f0a736c6c
|
@ -45,8 +45,6 @@ jobs:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@main
|
- uses: actions/checkout@main
|
||||||
- name: Check Clang-Format Version
|
|
||||||
run: clang-format --version
|
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: ./xb lint --all
|
run: ./xb lint --all
|
||||||
|
|
||||||
|
|
|
@ -53,8 +53,6 @@ jobs:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@main
|
- uses: actions/checkout@main
|
||||||
- name: Check Clang-Format Version
|
|
||||||
run: clang-format --version
|
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: .\xb lint --all
|
run: .\xb lint --all
|
||||||
|
|
||||||
|
|
20
xenia-build
20
xenia-build
|
@ -435,14 +435,10 @@ def get_clang_format_binary():
|
||||||
Returns:
|
Returns:
|
||||||
A path to the clang-format executable.
|
A path to the clang-format executable.
|
||||||
"""
|
"""
|
||||||
|
clang_format_minimum_ver='18'
|
||||||
attempts = [
|
attempts = [
|
||||||
'clang-format-19',
|
'clang-format-19',
|
||||||
'clang-format-18',
|
'clang-format-' + clang_format_minimum_ver,
|
||||||
'clang-format-17',
|
|
||||||
'clang-format-16',
|
|
||||||
'clang-format-15',
|
|
||||||
'clang-format-14',
|
|
||||||
'clang-format-13',
|
|
||||||
'clang-format',
|
'clang-format',
|
||||||
]
|
]
|
||||||
if sys.platform == 'win32':
|
if sys.platform == 'win32':
|
||||||
|
@ -452,10 +448,14 @@ def get_clang_format_binary():
|
||||||
attempts.append(os.path.join(os.environ['VCINSTALLDIR'], 'Tools', 'Llvm', 'bin', 'clang-format.exe'))
|
attempts.append(os.path.join(os.environ['VCINSTALLDIR'], 'Tools', 'Llvm', 'bin', 'clang-format.exe'))
|
||||||
for binary in attempts:
|
for binary in attempts:
|
||||||
if has_bin(binary):
|
if has_bin(binary):
|
||||||
|
shell_call([
|
||||||
|
binary,
|
||||||
|
'--version',
|
||||||
|
])
|
||||||
return binary
|
return binary
|
||||||
print('ERROR: clang-format is not on PATH')
|
print('ERROR: clang-format is not on PATH')
|
||||||
print('LLVM is available from https://llvm.org/releases/download.html')
|
print('LLVM is available from https://llvm.org/releases/download.html')
|
||||||
print('At least version 13 is required.')
|
print('At least version ' + clang_format_minimum_ver + ' is required.')
|
||||||
print('See docs/style_guide.md for instructions on how to get it.')
|
print('See docs/style_guide.md for instructions on how to get it.')
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
@ -851,12 +851,12 @@ class BaseBuildCommand(Command):
|
||||||
else:
|
else:
|
||||||
result = subprocess.call([
|
result = subprocess.call([
|
||||||
'cmake',
|
'cmake',
|
||||||
'-S build/',
|
'-Sbuild',
|
||||||
'-B build/build_%s' % (args['config']),
|
'-Bbuild/build_%s' % (args['config']),
|
||||||
'-DCMAKE_BUILD_TYPE=%s' % (args['config'].title()),
|
'-DCMAKE_BUILD_TYPE=%s' % (args['config'].title()),
|
||||||
'-DCMAKE_C_COMPILER=clang',
|
'-DCMAKE_C_COMPILER=clang',
|
||||||
'-DCMAKE_CXX_COMPILER=clang++',
|
'-DCMAKE_CXX_COMPILER=clang++',
|
||||||
'-G Ninja'
|
'-GNinja'
|
||||||
] + pass_args, shell=False, env=dict(os.environ))
|
] + pass_args, shell=False, env=dict(os.environ))
|
||||||
print('')
|
print('')
|
||||||
if result != 0:
|
if result != 0:
|
||||||
|
|
Loading…
Reference in New Issue