From e067c4a79d356105e8a636a2a4f5979e9ab3689d Mon Sep 17 00:00:00 2001 From: Nicolas Schneider Date: Tue, 15 Mar 2016 23:26:12 +0100 Subject: fix eval_custom_target_command() to use absolute paths for output files --- mesonbuild/backend/backends.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index 286afa924..5c2f70916 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -381,7 +381,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. -- cgit v1.2.3 From 3871f22cc30cafd69abf483c3c1eae68d1ad170a Mon Sep 17 00:00:00 2001 From: Nicolas Schneider Date: Tue, 15 Mar 2016 23:37:50 +0100 Subject: remove unnecessary os.path.join() calls ofilenames and srcs are already absolute paths. --- mesonbuild/backend/vs2010backend.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py index a72681bf2..0d7ac06d8 100644 --- a/mesonbuild/backend/vs2010backend.py +++ b/mesonbuild/backend/vs2010backend.py @@ -306,10 +306,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) -- cgit v1.2.3