summaryrefslogtreecommitdiff
path: root/giscanner/dumper.py
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2011-01-10 18:48:23 +0100
committerBenjamin Otte <otte@redhat.com>2011-01-10 19:20:56 +0100
commitbedd7dd61508684b78bd1e95fed8025d48661b48 (patch)
tree098e4f77bfe8c11712cbbb4bd26e8304a890bda0 /giscanner/dumper.py
parent34fad966c2f642dcf0cc9c7beefeb62dbb8fec60 (diff)
downloadgobject-introspection-bedd7dd61508684b78bd1e95fed8025d48661b48.tar.gz
scanner: Include all headers when building the dumper binary
This avoids warnings about undefined functions when using init sections and it removes the requirement to predeclare the get_type functions that should be called. For an example for this problem with GStreamer, see https://bugzilla.gnome.org/show_bug.cgi?id=639039 We can now also use gcc's error checking to ensure that users - specify the correct C includes in the gir file (because otherwise we get errors when compiling the dumper). - the types do actually exist (because again, the compiler will complain).
Diffstat (limited to 'giscanner/dumper.py')
-rw-r--r--giscanner/dumper.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/giscanner/dumper.py b/giscanner/dumper.py
index 3ea43e2c..538fe0e4 100644
--- a/giscanner/dumper.py
+++ b/giscanner/dumper.py
@@ -37,6 +37,8 @@ _PROGRAM_TEMPLATE = """/* This file is generated, do not edit */
#include <string.h>
#include <stdlib.h>
+%(c_include)s
+
%(gdump_include)s
int
@@ -107,6 +109,7 @@ class DumpCompiler(object):
gdump_file = open(gdump_path)
gdump_contents = gdump_file.read()
gdump_file.close()
+ tpl_args['c_include'] = "\n".join("#include <%s>" % i for i in self._options.c_includes)
tpl_args['gdump_include'] = gdump_contents
tpl_args['init_sections'] = "\n".join(self._options.init_sections)