Skip to content

Commit 07b6e22

Browse files
committed
Install LLVM headers for cxxdox
1 parent 9edd3ba commit 07b6e22

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

‎.github/workflows/docs.yml‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,20 @@ jobs:
3737
pip install mkdocs mkdocs-material mkdocs-github-admonitions-plugin mkdocs-minify-plugin mkdocs-redirects
3838
pip install https://github.com/kfrlib/cxxdox/releases/download/v0.2.0/mkdocs_cxxdox-0.2.0-py3-none-manylinux_2_17_x86_64.whl
3939
40+
# The libclang bundled in the cxxdox wheel has no resource directory, so
41+
# clang's builtin headers (stddef.h, stdarg.h, ...) are missing and every
42+
# header that pulls in <cstddef>/<cstdio> fails to parse. Install the
43+
# matching LLVM 21 builtin headers and expose them via CPATH.
44+
- name: Install clang builtin headers
45+
run: |
46+
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key \
47+
| sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc > /dev/null
48+
echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" \
49+
| sudo tee /etc/apt/sources.list.d/llvm-21.list
50+
sudo apt-get update
51+
sudo apt-get install -y libclang-common-21-dev
52+
echo "CPATH=$(echo /usr/lib/llvm-21/lib/clang/21*/include)" >> "$GITHUB_ENV"
53+
4054
- name: Inject main.html
4155
env:
4256
MKDOCS_MAIN: ${{ secrets.MKDOCS_MAIN }}

0 commit comments

Comments
 (0)