diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index 5cc2442e4..2861bb6c9 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.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) diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 63380bd52..89d6a6f74 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -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)