Skip to content

Commit b7e5acb

Browse files
elliejsclaude
andauthored
Use -idirafter for system includes in translation unit (#64)
Change get_includes() paths from -I to -idirafter so they are searched after all system headers. This prevents include-path conflicts when the libclang version differs from the system compiler (e.g. FreeBSD with clang-19 system headers and libclang-21), where -I would break #include_next chains. Co-authored-by: elliejs <elliejs@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f378d84 commit b7e5acb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

bindgen/translation_unit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def parse_tu(
3838
args.append(f"--sysroot={prefix}")
3939

4040
for inc in get_includes():
41-
args.append(f"-I{inc}")
41+
args.extend(["-idirafter", inc])
4242

4343
for inc in platform_includes:
4444
args.append(f"-I{inc}")

0 commit comments

Comments
 (0)