aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/backends.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-08-20 21:01:49 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2016-08-20 21:01:49 +0300
commit3ae918a4633514e69e906bbfb4b5e3dc5d128391 (patch)
treec2cf7fc08e63b00a0eb5ce38b0023a2d90892a75 /mesonbuild/backend/backends.py
parentd6fd462387dc60bb7204c8172ef427917d66987e (diff)
downloadmeson-3ae918a4633514e69e906bbfb4b5e3dc5d128391.zip
meson-3ae918a4633514e69e906bbfb4b5e3dc5d128391.tar.gz
meson-3ae918a4633514e69e906bbfb4b5e3dc5d128391.tar.bz2
Add support for dependency files in custom targets.
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r--mesonbuild/backend/backends.py6
1 files changed, 5 insertions, 1 deletions
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))