JuliaInterop / Clang.jl

C binding generator and Julia interface to libclang
https://juliainterop.github.io/Clang.jl/
MIT License
217 stars 68 forks source link

Add support for checking `library_names` in the generator auditor #477

Closed JamesWrigley closed 4 months ago

JamesWrigley commented 4 months ago

This fixes spurious warnings when library_names is set instead of library_name.

Fixes #476.

Gnimuc commented 4 months ago

library_name is the fallback libname for those headers that are not captured by library_names.

test case:

# library_name = ">/+-;'[]{}()!@#$%^&*~`"
library_names = {}
JamesWrigley commented 4 months ago

Alrighty, I did a second attempt in 891aff4. Now the auditor will check both library_name and the lib names in library_names for validity, and it'll only log a warning if library_name is not set and library_names doesn't contain entries for all the headers. I had to modify the Audit pass and TranslationUnit a bit to make that work since we don't store the passed headers in a Context (and I figured it made sense to store the file path with its TranslationUnit).

ViralBShah commented 4 months ago

Thanks folks!