From 3ae918a4633514e69e906bbfb4b5e3dc5d128391 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Sat, 20 Aug 2016 21:01:49 +0300 Subject: Add support for dependency files in custom targets. --- mesonbuild/backend/backends.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'mesonbuild/backend/backends.py') diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index 1f1c3ca..4d0af4b 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -551,6 +551,11 @@ class Backend(): else: if '@OUTDIR@' in i: i = i.replace('@OUTDIR@', outdir) + elif '@DEPFILE@' in i: + if target.depfile is None: + raise MesonException('Custom target %s has @DEPFILE@ but no depfile keyword argument.' % target.name) + dfilename = os.path.join(self.get_target_private_dir(target), target.depfile) + i = i.replace('@DEPFILE@', dfilename) elif '@PRIVATE_OUTDIR_' in i: match = re.search('@PRIVATE_OUTDIR_(ABS_)?([-a-zA-Z0-9.@:]*)@', i) source = match.group(0) @@ -558,7 +563,6 @@ class Backend(): lead_dir = '' else: lead_dir = self.environment.get_build_dir() - target_id = match.group(2) i = i.replace(source, os.path.join(lead_dir, outdir)) -- cgit v1.1