Require specific clang-format version

Also update ancient Linux building instructions.
This commit is contained in:
Margen67 2025-07-11 03:02:07 -07:00
parent f2a2812c67
commit 3b49edc3c6
2 changed files with 12 additions and 14 deletions

View file

@ -88,18 +88,18 @@ get helpful spacers/movs in the disassembly.
Linux support is extremely experimental and presently incomplete. Linux support is extremely experimental and presently incomplete.
The build script uses LLVM/Clang 9. GCC while it should work in theory, is not easily The build script uses LLVM/Clang 19. GCC while it should work in theory, is not easily
interchangeable right now. interchangeable right now.
* Normal building via `xb build` uses Make. * Normal building via `xb build` uses CMake+Ninja.
* [CodeLite](https://codelite.org) is supported. `xb devenv` will generate a workspace and attempt to open it. Your distribution's version may be out of date so check their website. * [CodeLite](https://codelite.org) is supported. `xb devenv` will generate a workspace and attempt to open it. Your distribution's version may be out of date so check their website.
* Experimental CMake generation is available to facilitate use of other IDEs such as [CLion](https://www.jetbrains.com/clion/). If `clion` is available inside `$PATH`, `xb devenv` will start it. Otherwise `build/CMakeLists.txt` needs to be generated by invoking `xb premake --devenv=cmake` manually. * Experimental CMake generation is available to facilitate use of other IDEs such as [CLion](https://www.jetbrains.com/clion/). If `clion` is available inside `$PATH`, `xb devenv` will start it. Otherwise `build/CMakeLists.txt` needs to be generated by invoking `xb premake --devenv=cmake` manually.
Clang-9 or newer should be available from system repositories on all up to date distributions. Clang-19 or newer should be available from system repositories on all up to date distributions.
You will also need some development libraries. To get them on an Ubuntu system: You will also need some development libraries. To get them on an Ubuntu system:
```bash ```sh
sudo apt-get install libgtk-3-dev libpthread-stubs0-dev liblz4-dev libx11-dev libx11-xcb-dev libvulkan-dev libsdl2-dev libiberty-dev libunwind-dev libc++-dev libc++abi-dev sudo apt-get install mesa-vulkan-drivers valgrind libc++-dev libc++abi-dev libgtk-3-dev libsdl2-dev libvulkan-dev libx11-xcb-dev clang-19 llvm-19 ninja-build
``` ```
In addition, you will need up to date Vulkan libraries and drivers for your hardware, which most distributions have in their standard repositories nowadays. In addition, you will need up to date Vulkan libraries and drivers for your hardware, which most distributions have in their standard repositories nowadays.

View file

@ -443,10 +443,9 @@ 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='19' clang_format_version_req = '19'
attempts = [ attempts = [
'clang-format-20', 'clang-format-' + clang_format_version_req,
'clang-format-' + clang_format_minimum_ver,
'clang-format', 'clang-format',
] ]
if sys.platform == 'win32': if sys.platform == 'win32':
@ -456,13 +455,12 @@ 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([ clang_format_out = subprocess.check_output([binary, '--version'], text=True)
binary, if int(clang_format_out.split('version ')[1].split('.')[0]) >= int(clang_format_version_req):
'--version', print(clang_format_out)
]) return binary
return binary
print('ERROR: clang-format is not on PATH') print('ERROR: clang-format is not on PATH')
print('At least version ' + clang_format_minimum_ver + ' is required.') print('Version ' + clang_format_version_req + ' 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)