Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
54 lines (38 sloc) 1.59 KB
cilc
====
cilc is a CIL-to-C binding generator. It can be used to expose any CIL library
to the C (and C++) world using the GObject object model and coding style. This
should be of particular interest to GNOME developers who wish to make use of
libraries developed in C#, perhaps Gtk# widgets, within their own C
applications. Developers who use a generated binding need no specific knowledge
pertaining to Mono and runtime embedding -- almost everything is done behind
the scenes.
Right now, cilc is in an early stage of development. See TODO for a list of
pending tasks.
For a demonstration, see Test.cs and demo.c to get an idea of what's going on.
Then run:
$ make run-test-local
$ cd generated
$ ./demo
To make a redistributable shared object that includes the assembly, you can
then:
$ make clean
$ make bundle=true
$ rm *.dll
$ ./demo
Note that you must have Mono's mkbundle tool installed to use the bundle
feature.
If all you want to do is generate a binding for an assembly, you can simply
pass the assembly name as a single argument to cilc and it will automatically
generate bindings in a temporary directory, compile them using the bundle
feature, and install the produced shared library in the lib/ subdirectory and
the headers in include/.
$ cilc Assembly.dll
To tie-in with existing GOjbect hierarchies, pass pairs of pkg-config package
and comma-separated namespaces. For example:
If you want to use a Gtk# widget in a Gtk+ application:
$ cilc Widget.dll gtk+-2.0 gtk
To bind gtk-sharp, but tying it into the native hierarchy for gdk:
$ cilc gtk-sharp.dll gtk+-2.0 gdk
--
Alp Toker <alp@atoker.com>