diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py index 48958cd0e..e34712a11 100644 --- a/mesonbuild/backend/vs2010backend.py +++ b/mesonbuild/backend/vs2010backend.py @@ -129,10 +129,9 @@ class Vs2010Backend(backends.Backend): args = self.replace_outputs(args, target_private_dir, outfiles_rel) args = [x.replace("@SOURCE_DIR@", self.environment.get_source_dir()).replace("@BUILD_DIR@", target_private_dir) for x in args] - fullcmd = exe_arr + self.replace_extra_args(args, genlist) - command = ' '.join(self.special_quote(fullcmd)) + cmd = exe_arr + self.replace_extra_args(args, genlist) cbs = ET.SubElement(idgroup, 'CustomBuild', Include=infilename) - ET.SubElement(cbs, 'Command').text = command + ET.SubElement(cbs, 'Command').text = ' '.join(self.quote_arguments(cmd)) ET.SubElement(cbs, 'Outputs').text = ';'.join(outfiles) return generator_output_files, custom_target_output_files, custom_target_include_dirs @@ -331,8 +330,8 @@ class Vs2010Backend(backends.Backend): directories = os.path.normpath(target.subdir).split(os.sep) return os.sep.join(['..'] * len(directories)) - def special_quote(self, arr): - return ['"%s"' % i for i in arr] + def quote_arguments(self, arr): + return ['"%s"' % i for i in arr] def create_basic_crap(self, target): project_name = target.name @@ -404,8 +403,7 @@ 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) - cmd_templ = '''"%s" ''' * len(cmd) - ET.SubElement(customstep, 'Command').text = cmd_templ % tuple(cmd) + ET.SubElement(customstep, 'Command').text = ' '.join(self.quote_arguments(cmd)) ET.SubElement(customstep, 'Outputs').text = ';'.join(ofilenames) ET.SubElement(customstep, 'Inputs').text = ';'.join(srcs) ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.targets')