aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/build.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/build.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/build.py')
-rw-r--r--mesonbuild/build.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 0922dfb..c92c99f 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -931,6 +931,7 @@ class CustomTarget:
'build_always' : True,
'depends' : True,
'depend_files' : True,
+ 'depfile' : True,
}
def __init__(self, name, subdir, kwargs):
@@ -939,6 +940,7 @@ class CustomTarget:
self.dependencies = []
self.extra_depends = []
self.depend_files = [] # Files that this target depends on but are not on the command line.
+ self.depfile = None
self.process_kwargs(kwargs)
self.extra_files = []
self.install_rpath = ''
@@ -983,6 +985,13 @@ class CustomTarget:
raise InvalidArguments('Output must not contain a path segment.')
if 'command' not in kwargs:
raise InvalidArguments('Missing keyword argument "command".')
+ if 'depfile' in kwargs:
+ depfile = kwargs['depfile']
+ if not isinstance(depfile, str):
+ raise InvalidArguments('Depfile must be a string.')
+ if os.path.split(depfile)[1] != depfile:
+ raise InvalidArguments('Depfile must be a plain filename without a subdirectory.')
+ self.depfile = depfile
cmd = kwargs['command']
if not(isinstance(cmd, list)):
cmd = [cmd]