Merge branch 'Custom target absolute paths'.

pull/478/head
Jussi Pakkanen 9 years ago
commit 9071c8fc45
  1. 6
      mesonbuild/backend/backends.py
  2. 6
      mesonbuild/backend/vs2010backend.py

@ -386,7 +386,11 @@ class Backend():
return exe_arr
def eval_custom_target_command(self, target, absolute_paths=False):
ofilenames = [os.path.join(self.get_target_dir(target), i) for i in target.output]
if not absolute_paths:
ofilenames = [os.path.join(self.get_target_dir(target), i) for i in target.output]
else:
ofilenames = [os.path.join(self.environment.get_build_dir(), self.get_target_dir(target), i) \
for i in target.output]
srcs = []
outdir = self.get_target_dir(target)
# Many external programs fail on empty arguments.

@ -313,10 +313,8 @@ class Vs2010Backend(backends.Backend):
(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, 'Outputs').text = ';'.join([os.path.join(self.environment.get_build_dir(), i)\
for i in ofilenames])
ET.SubElement(customstep, 'Inputs').text = ';'.join([os.path.join(self.environment.get_build_dir(), i) \
for i in srcs])
ET.SubElement(customstep, 'Outputs').text = ';'.join(ofilenames)
ET.SubElement(customstep, 'Inputs').text = ';'.join(srcs)
ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.targets')
tree = ET.ElementTree(root)
tree.write(ofname, encoding='utf-8', xml_declaration=True)

Loading…
Cancel
Save