summaryrefslogtreecommitdiff
path: root/giscanner
diff options
context:
space:
mode:
authorChristoph Reiter <reiter.christoph@gmail.com>2018-12-17 19:30:11 +0100
committerChristoph Reiter <reiter.christoph@gmail.com>2018-12-17 20:17:49 +0100
commit00a9916668b57b7ace1ddba49be73a9356afdb1c (patch)
tree1b292a46074c3f41317f878cadf3efa73aa71ea0 /giscanner
parent834e800f59995cc40bf0e044bdd1bff086555eab (diff)
downloadgobject-introspection-00a9916668b57b7ace1ddba49be73a9356afdb1c.tar.gz
meson: install everything.c/h like with autotools
This requires a code change in codegen.py to support the case whre output files are not installed in the working directory. Instead of using the output path for the header include use the relative path to the output source file.
Diffstat (limited to 'giscanner')
-rw-r--r--giscanner/codegen.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/giscanner/codegen.py b/giscanner/codegen.py
index ce07aaa1..138acf72 100644
--- a/giscanner/codegen.py
+++ b/giscanner/codegen.py
@@ -18,6 +18,7 @@
# Boston, MA 02111-1307, USA.
#
+import os
from contextlib import contextmanager
from . import ast
@@ -142,7 +143,9 @@ class CCodeGenerator(object):
for header in self.include_first_src:
self.out_c.write("""#include "%s"\n""" % header)
- self.out_c.write("""#include "%s"\n\n""" % (self.out_h_filename, ))
+ src_dir = os.path.dirname(os.path.realpath(self.out_c.name))
+ header = os.path.relpath(self.out_h_filename, src_dir)
+ self.out_c.write("""#include "%s"\n\n""" % (header, ))
for header in self.include_last_src:
self.out_c.write("""#include "%s"\n""" % header)