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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions authors.txt
Expand Up @@ -35,3 +35,4 @@ Rogiel Sulzbach
Tim-Philipp Müller
Emmanuele Bassi
Martin Hostettler
Sam Thursfield
4 changes: 2 additions & 2 deletions mesonbuild/backend/ninjabackend.py
Expand Up @@ -772,7 +772,7 @@ def determine_dep_vapis(self, target):
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
Expand All @@ -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.

base_vapi = namebase + '.vapi'
hname = os.path.normpath(os.path.join(self.get_target_dir(target), base_h))
Expand Down