Install Libclang¶
CLI tool for installing the libclang system dependency.
CLI Usage¶
headerkit install-libclang [--version VERSION] [--skip-verify]
python -m headerkit.install_libclang [--version VERSION] [--skip-verify]
See the Installing libclang guide for detailed usage, platform behavior, and CI examples.
API Reference¶
install_libclang
¶
Install libclang for the current platform.
Usage::
python -m headerkit.install_libclang [--version VERSION]
This module installs the libclang shared library so that headerkit's libclang backend can function. It handles platform-specific installation:
- Linux (RHEL/Fedora/AlmaLinux):
dnf install clang-libs(falls back toclang-devel) - Linux (Debian/Ubuntu):
apt-get install libclang-dev - Linux (Alpine):
apk add clang-dev - macOS:
brew install llvm(via Homebrew) - Windows x64:
choco install llvm(via Chocolatey) - Windows ARM64: Downloads native woa64 installer from LLVM GitHub releases
After installation, verifies that libclang is loadable by headerkit.
install_linux
¶
Install libclang on Linux using the available package manager.
Source code in headerkit/install_libclang.py
install_macos
¶
Install libclang on macOS using Homebrew.
Source code in headerkit/install_libclang.py
install_windows
¶
Install libclang on Windows.
On ARM64, downloads the native woa64 installer from LLVM GitHub releases. On x64, uses Chocolatey with the same pinned LLVM version.
Source code in headerkit/install_libclang.py
verify_libclang
¶
Verify that libclang is now loadable by headerkit.
Source code in headerkit/install_libclang.py
auto_install
¶
Quietly auto-install libclang if not already available.
This is the non-interactive counterpart to main(). It is called by
generate() when the libclang backend is needed but unavailable.
- Idempotent: returns True immediately if libclang is already loadable.
- Suppresses stdout from the underlying install functions so that
callers (e.g.
generate()) never see unexpected print output. - Logs progress via the
headerkit.installlogger instead of printing. - Always verifies after installation (no
--skip-verify).
Returns:
| Type | Description |
|---|---|
bool
|
True if libclang is available after this call, False otherwise. |