Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use target name to decide generated Vala .h & .vapi filenames #594

Merged
merged 2 commits into from Jun 16, 2016

Conversation

ssssam
Copy link
Contributor

@ssssam ssssam commented Jun 14, 2016

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.

This fixes #504

@jpakkane
Copy link
Member

Seems reasonable. Please add yourself to authors.txt and we'll merge this. Thanks.

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.
@jpakkane jpakkane merged commit 217e059 into mesonbuild:master Jun 16, 2016
@@ -790,7 +790,7 @@ def generate_vala_compile(self, compiler, target, outfile):
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'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is problematic because we generally want the header to be installed in a folder named from the target name (e.g. foo-1.0/foo.h), not the file itself. I think that we should strip the -MAJOR.MINOR suffix for generating base_h.

For other files (GIR, deps, VAPI, ...) that's fine since it's already the convention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use the target as namebase for Vala
3 participants