diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2016-06-14 01:03:43 +0100 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2016-06-15 15:15:58 +0100 |
commit | a661708b54d5c6f9aa280663a85ab15ed06f40ce (patch) | |
tree | 8b7a39029f51df697fb96ad9da6dd81805c6be5e | |
parent | f7eef79c0dd8adf74f79a85ca814f07c9beb4e29 (diff) | |
download | meson-a661708b54d5c6f9aa280663a85ab15ed06f40ce.zip meson-a661708b54d5c6f9aa280663a85ab15ed06f40ce.tar.gz meson-a661708b54d5c6f9aa280663a85ab15ed06f40ce.tar.bz2 |
Use target name to decide generated Vala .h & .vapi filenames
Previously Meson would use the name of the first .vala source file. This
doesn't work for some projects. Tracker is one example: it has
several libraries that mix Vala and C code. In such cases, none of the
.vala files tend to bear the name of the library we actually want to
generate.
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index b3f3f17..9ceee32 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -772,7 +772,7 @@ int dummy; if hasattr(i, 'fname'): i = i.fname if i.endswith('vala'): - vapiname = os.path.splitext(os.path.split(i)[1])[0] + '.vapi' + vapiname = dep.name + '.vapi' fullname = os.path.join(self.get_target_dir(dep), vapiname) result.append(fullname) break @@ -790,7 +790,7 @@ int dummy; vala_input_files.append(s.rel_to_builddir(self.build_to_src)) if len(src) == 0: raise InvalidArguments('Vala library has no Vala source files.') - namebase = os.path.splitext(os.path.split(src[0].fname)[1])[0] + namebase = target.name base_h = namebase + '.h' base_vapi = namebase + '.vapi' hname = os.path.normpath(os.path.join(self.get_target_dir(target), base_h)) |