diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-03-23 11:35:30 +0530 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-03-23 16:38:03 -0400 |
commit | 53795d89df48ca722b018ff8720669deb6209be4 (patch) | |
tree | b9ba2d48921b1d1b468d6800627776c80fbe044c /mesonbuild/backend/vs2010backend.py | |
parent | df1480fe11e5d4f20b7305abc2129d3c6494d1b5 (diff) | |
download | meson-53795d89df48ca722b018ff8720669deb6209be4.zip meson-53795d89df48ca722b018ff8720669deb6209be4.tar.gz meson-53795d89df48ca722b018ff8720669deb6209be4.tar.bz2 |
vs: Always use a wrapper for custom target commands
Besides fixing output capture, it also fixes a strange bug in MSBuild
where if the command list is too long, it will remove random
characters from the command list before passing it to the command.
Closes https://github.com/mesonbuild/meson/issues/1417
Diffstat (limited to 'mesonbuild/backend/vs2010backend.py')
-rw-r--r-- | mesonbuild/backend/vs2010backend.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py index e1f7325..82c6463 100644 --- a/mesonbuild/backend/vs2010backend.py +++ b/mesonbuild/backend/vs2010backend.py @@ -403,7 +403,16 @@ class Vs2010Backend(backends.Backend): # from the target dir, not the build root. target.absolute_paths = True (srcs, ofilenames, cmd) = self.eval_custom_target_command(target, True) - ET.SubElement(customstep, 'Command').text = ' '.join(self.quote_arguments(cmd)) + # Always use a wrapper because MSBuild eats random characters when + # there are many arguments. + tdir_abs = os.path.join(self.environment.get_build_dir(), self.get_target_dir(target)) + exe_data = self.serialise_executable(target.command[0], cmd[1:], + # All targets run from the target dir + tdir_abs, + capture=ofilenames[0] if target.capture else None) + wrapper_cmd = [sys.executable, self.environment.get_build_command(), + '--internal', 'exe', exe_data] + ET.SubElement(customstep, 'Command').text = ' '.join(self.quote_arguments(wrapper_cmd)) ET.SubElement(customstep, 'Outputs').text = ';'.join(ofilenames) ET.SubElement(customstep, 'Inputs').text = ';'.join(srcs) ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.targets') |