Skip to content

Commit ff92951

Browse files
cfisclaude
andcommitted
Add test headers root to clang include path
Ensures relative includes like #include "clang-c/BuildSystem.h" resolve correctly on all platforms. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e7f1c0b commit ff92951

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

test/abstract_test.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ def create_parser(header, args = nil)
6161
config = load_bindings_config
6262
args = config[:clang_args]
6363
end
64+
# Add test headers root to include path so relative includes work
65+
# e.g., for "c/clang-c/index.h", add test/headers/c so #include "clang-c/BuildSystem.h" resolves
66+
headers_root = File.join(__dir__, "headers", header.split('/').first)
67+
args = Array(args) + ["-I#{headers_root}"]
6468
RubyBindgen::Parser.new(self.create_inputter(header), args)
6569
end
6670

0 commit comments

Comments
 (0)