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 flag to control outputting of system code #485

Closed Octogonapus closed 3 months ago

Octogonapus commented 3 months ago

This PR adds a flag output_system (true by default for backwards compatibility) which controls whether code in system headers will be output. Setting this flag to false allows the user to effectively avoid emitting code for dependencies by including those dependencies as system headers.

I have tested this with my MWE in #484 and it solves that issue.

Fixes #484.

Gnimuc commented 3 months ago

I changed the option name to generate_isystem_symbols and tweaked the code a little.

Octogonapus commented 3 months ago

After fixing the logic and trying it out, this new implementation is very slow because the ignorelist is quite large and running all of those regular expressions is slow. I would recommend to use the prior implementation because it is much faster.

Gnimuc commented 3 months ago

@Octogonapus fixed again.

Octogonapus commented 3 months ago

LGTM!