diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2016-08-27 13:42:13 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-27 13:42:13 +0300 |
commit | 4e050c3d9b545a8c8e136d5c8e7eb9cee988fbc6 (patch) | |
tree | fd64a026c5c364ce296230ac40f68224318efbc7 /mesonbuild/backend/ninjabackend.py | |
parent | 3ed1ff1c714e35beb82d02a9f1a1bccb992329b2 (diff) | |
parent | b7757189e4eb8a17182d07cdcad53e8f5ebad0ce (diff) | |
download | meson-4e050c3d9b545a8c8e136d5c8e7eb9cee988fbc6.zip meson-4e050c3d9b545a8c8e136d5c8e7eb9cee988fbc6.tar.gz meson-4e050c3d9b545a8c8e136d5c8e7eb9cee988fbc6.tar.bz2 |
Merge pull request #712 from QuLogic/capturing-custom-target
Allow capturing command output of a custom target.
Diffstat (limited to 'mesonbuild/backend/ninjabackend.py')
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 15f298b..7855729 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -379,15 +379,19 @@ int dummy; tmp = [tmp] for fname in tmp: elem.add_dep(os.path.join(self.get_target_dir(d), fname)) + # If the target requires capturing stdout, then use the serialized + # executable wrapper to capture that output and save it to a file. + # # Windows doesn't have -rpath, so for EXEs that need DLLs built within # the project, we need to set PATH so the DLLs are found. We use # a serialized executable wrapper for that and check if the # CustomTarget command needs extra paths first. - if mesonlib.is_windows() and \ - self.determine_windows_extra_paths(target.command[0]): + if target.capture or (mesonlib.is_windows() and + self.determine_windows_extra_paths(target.command[0])): exe_data = self.serialise_executable(target.command[0], cmd[1:], # All targets are built from the build dir - self.environment.get_build_dir()) + self.environment.get_build_dir(), + capture=ofilenames[0] if target.capture else None) cmd = [sys.executable, self.environment.get_build_command(), '--internal', 'exe', exe_data] cmd_type = 'meson_exe.py custom' |