GNOME Bugzilla – Bug 572423
Add c:header-filename or c:header-filenames where appropriate
Last modified: 2015-02-07 16:55:08 UTC
Bindings that links to shared library, needs to have the header filenames. Exact header search path can be extracted from pkgconfig file.
Which header filenames? The ones we scanned, or the ones you should include in C? Remember that several libraries only allow you to #include one header. What will this be used for?
The ones that should be included in C. Even if there is only one header file to include, we have to know that header filename. For instance, Valac generates C code that should include those headers. As an example, here is a VAPI part that should be generated from gir: [CCode (cprefix = "G", lower_case_cprefix = "g_")] namespace GLib { [CCode (cheader_filename = "gio/gio.h")] public class AppLaunchContext : GLib.Object { ... You can see that we cannot guess "gio/gio.h".
Ok. So to implement this I'd suggest a new option for the scanner: --c-include="gio/gio.h" (May be specified multiple times).
--c-include="..." sounds good to me. Having this specified multiple times in the command line means you will generate a c:header-filenames="header1, header2, ..." on the namespace element ?
Created attachment 129104 [details] [review] Bug 572423 - Support --c-include argument for specifying C headers This option is for specifying inside the .gir what C header files should be included by C consumers (as opposed to parsed by the scanner).
Comment on attachment 129104 [details] [review] Bug 572423 - Support --c-include argument for specifying C headers Looks pretty good.
Does work correctly here. And this is exactely what we expected. Could you commit this ?
Still need to update gir-repository. commit ff4628ced457a5460f854abb8cdf923cd67c4e6e Author: Colin Walters <walters@verbum.org> Date: Thu Feb 19 17:52:22 2009 -0500 Bug 572423 - Support --c-include argument for specifying C headers This option is for specifying inside the .gir what C header files should be included by C consumers (as opposed to parsed by the scanner).
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]