backends: Output depfiles in same directory as target

pull/991/head
Patrick Griffis 8 years ago committed by Igor Gnatenko
parent 5fdac48250
commit 573b3afb52
  1. 5
      mesonbuild/backend/backends.py
  2. 4
      mesonbuild/backend/ninjabackend.py

@ -599,10 +599,7 @@ class Backend():
elif '@DEPFILE@' in i:
if target.depfile is None:
raise MesonException('Custom target %s has @DEPFILE@ but no depfile keyword argument.' % target.name)
if absolute_paths:
dfilename = os.path.join(self.get_target_private_dir_abs(target), target.depfile)
else:
dfilename = os.path.join(self.get_target_private_dir(target), target.depfile)
dfilename = os.path.join(outdir, target.depfile)
i = i.replace('@DEPFILE@', dfilename)
elif '@PRIVATE_OUTDIR_' in i:
match = re.search('@PRIVATE_OUTDIR_(ABS_)?([-a-zA-Z0-9.@:]*)@', i)

@ -494,8 +494,8 @@ int dummy;
cmd_type = 'custom'
if target.depfile is not None:
rel_dfile = os.path.join(self.get_target_private_dir(target), target.depfile)
abs_pdir = os.path.join(self.environment.get_build_dir(), self.get_target_private_dir(target))
rel_dfile = os.path.join(self.get_target_dir(target), target.depfile)
abs_pdir = os.path.join(self.environment.get_build_dir(), self.get_target_dir(target))
os.makedirs(abs_pdir, exist_ok=True)
elem.add_item('DEPFILE', rel_dfile)
elem.add_item('COMMAND', cmd)

Loading…
Cancel
Save