diff options
-rw-r--r-- | mesonbuild/backend/vs2010backend.py | 11 | ||||
-rw-r--r-- | test cases/common/117 custom target capture/meson.build | 4 |
2 files changed, 10 insertions, 5 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') diff --git a/test cases/common/117 custom target capture/meson.build b/test cases/common/117 custom target capture/meson.build index 16b6ac9..58a69ca 100644 --- a/test cases/common/117 custom target capture/meson.build +++ b/test cases/common/117 custom target capture/meson.build @@ -2,10 +2,6 @@ project('custom target', 'c') python3 = import('python3').find_python() -if meson.backend().startswith('vs') - error('MESON_SKIP_TEST: capturing of custom target output is broken with the VS backends') -endif - # Note that this will not add a dependency to the compiler executable. # Code will not be rebuilt if it changes. comp = '@0@/@1@'.format(meson.current_source_dir(), 'my_compiler.py') |