From 1c8e9fc7aed01f55cb94a8997127ebf85af26000 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Thu, 20 Apr 2017 12:30:18 -0400 Subject: Stricter evaluation of deps. Closes #1648. --- mesonbuild/modules/gnome.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py index 6921472..b4dfd12 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py @@ -253,6 +253,8 @@ class GnomeModule(ExtensionModule): missing_basename = os.path.basename(missing) for dep in dependencies: + if hasattr(dep, 'held_object'): + dep = dep.held_object if isinstance(dep, mesonlib.File): if dep.fname == missing_basename: found = True @@ -260,18 +262,20 @@ class GnomeModule(ExtensionModule): dep_files.append(dep) subdirs.append(dep.subdir) break - elif isinstance(dep, interpreter.CustomTargetHolder): - if dep.held_object.get_basename() == missing_basename: + elif isinstance(dep, build.CustomTarget): + if dep.get_basename() == missing_basename: found = True dep_files.remove(missing) dep_files.append( mesonlib.File( is_built=True, - subdir=dep.held_object.get_subdir(), - fname=dep.held_object.get_basename())) - depends.append(dep.held_object) - subdirs.append(dep.held_object.get_subdir()) + subdir=dep.get_subdir(), + fname=dep.get_basename())) + depends.append(dep) + subdirs.append(dep.get_subdir()) break + else: + raise RuntimeError('Unreachable code.') if not found: raise MesonException( -- cgit v1.1