aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/backends.py
diff options
context:
space:
mode:
authorElliott Sales de Andrade <quantum.analyst@gmail.com>2016-08-24 04:35:15 -0400
committerElliott Sales de Andrade <quantum.analyst@gmail.com>2016-08-26 20:46:42 -0400
commit70d94a555004563178878b73274e345adff5b4e8 (patch)
treea5944eecebc2992e322e42364148d63ba73acda8 /mesonbuild/backend/backends.py
parentdcaf2d7b3d010526eb5035fec788f1b9a854262c (diff)
downloadmeson-70d94a555004563178878b73274e345adff5b4e8.zip
meson-70d94a555004563178878b73274e345adff5b4e8.tar.gz
meson-70d94a555004563178878b73274e345adff5b4e8.tar.bz2
Allow capturing command output of a custom target.
For commands that always output to stdout and don't have a "-o" or "--output" or some other similar option, this 'capture' setting allows the build to capture the result and place it in the output file.
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r--mesonbuild/backend/backends.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index bdba44f..fbc5079 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -37,7 +37,7 @@ class InstallData():
class ExecutableSerialisation():
def __init__(self, name, fname, cmd_args, env, is_cross, exe_wrapper,
- workdir, extra_paths):
+ workdir, extra_paths, capture):
self.name = name
self.fname = fname
self.cmd_args = cmd_args
@@ -46,6 +46,7 @@ class ExecutableSerialisation():
self.exe_runner = exe_wrapper
self.workdir = workdir
self.extra_paths = extra_paths
+ self.capture = capture
class TestSerialisation:
def __init__(self, name, suite, fname, is_cross, exe_wrapper, is_parallel, cmd_args, env,
@@ -176,7 +177,8 @@ class Backend():
raise MesonException('Unknown data type in object list.')
return obj_list
- def serialise_executable(self, exe, cmd_args, workdir, env={}):
+ def serialise_executable(self, exe, cmd_args, workdir, env={},
+ capture=None):
import uuid
# Can't just use exe.name here; it will likely be run more than once
if isinstance(exe, (dependencies.ExternalProgram,
@@ -207,7 +209,7 @@ class Backend():
extra_paths = []
es = ExecutableSerialisation(basename, exe_fullpath, cmd_args, env,
is_cross, exe_wrapper, workdir,
- extra_paths)
+ extra_paths, capture)
pickle.dump(es, f)
return exe_data