aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2017-08-10 02:52:45 +0530
committerJussi Pakkanen <jpakkane@gmail.com>2017-08-13 21:13:28 +0300
commit7aed29e2c33d60fee5f6bac89bd17aaf6b770b04 (patch)
tree91c4929e8b72d54716c0b9aad2e3aeefb9720d79
parent691ad706ad81341ad4b84730d77de39a4fb2a153 (diff)
downloadmeson-7aed29e2c33d60fee5f6bac89bd17aaf6b770b04.zip
meson-7aed29e2c33d60fee5f6bac89bd17aaf6b770b04.tar.gz
meson-7aed29e2c33d60fee5f6bac89bd17aaf6b770b04.tar.bz2
gnome: Fix parsing of resource custom target files
gnome.compile_resources() was not parsing custom target sources properly. It was using the custom target name as the output of the custom target instead of looking at the list of outputs. Also modify the GNOME framework test to expose this.
-rw-r--r--mesonbuild/modules/gnome.py23
-rw-r--r--test cases/frameworks/7 gnome/resources-data/meson.build2
2 files changed, 16 insertions, 9 deletions
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index 685a86b..f4329d9 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -259,21 +259,28 @@ class GnomeModule(ExtensionModule):
if hasattr(dep, 'held_object'):
dep = dep.held_object
if isinstance(dep, mesonlib.File):
- if dep.fname == missing_basename:
- found = True
- dep_files.remove(missing)
- dep_files.append(dep)
- subdirs.append(dep.subdir)
- break
+ if dep.fname != missing_basename:
+ continue
+ found = True
+ dep_files.remove(missing)
+ dep_files.append(dep)
+ subdirs.append(dep.subdir)
+ break
elif isinstance(dep, build.CustomTarget):
- if dep.get_basename() == missing_basename:
+ fname = None
+ outputs = {(o, os.path.basename(o)) for o in dep.get_outputs()}
+ for o, baseo in outputs:
+ if baseo == missing_basename:
+ fname = o
+ break
+ if fname is not None:
found = True
dep_files.remove(missing)
dep_files.append(
mesonlib.File(
is_built=True,
subdir=dep.get_subdir(),
- fname=dep.get_basename()))
+ fname=fname))
depends.append(dep)
subdirs.append(dep.get_subdir())
break
diff --git a/test cases/frameworks/7 gnome/resources-data/meson.build b/test cases/frameworks/7 gnome/resources-data/meson.build
index 9458c2d..31a577b 100644
--- a/test cases/frameworks/7 gnome/resources-data/meson.build
+++ b/test cases/frameworks/7 gnome/resources-data/meson.build
@@ -10,7 +10,7 @@ print("This is a generated resource.")
# Generate file res3.txt from file res3.txt.in. This is then included
# in a GResource file, driven by resources/meson.build.
-res3_txt = custom_target('res3.txt',
+res3_txt = custom_target('res3',
input: 'res3.txt.in',
output: 'res3.txt',
command: [python3, '-c', fake_generator_script, '@INPUT@'],