From 7ed515dacc726b6413ff720b7c125670b60543a1 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Mon, 7 Dec 2015 21:52:08 +0200 Subject: [PATCH] Refactored dep file name so Swift dependency tracking works. --- compilers.py | 9 +++++++++ ninjabackend.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/compilers.py b/compilers.py index d29759255..41c4ecd29 100644 --- a/compilers.py +++ b/compilers.py @@ -215,6 +215,9 @@ class CCompiler(Compiler): def get_dependency_gen_args(self, outtarget, outfile): return ['-MMD', '-MQ', outtarget, '-MF', outfile] + def depfile_for_object(self, objfile): + return objfile + '.' + self.get_depfile_suffix() + def get_depfile_suffix(self): return 'd' @@ -985,6 +988,9 @@ class SwiftCompiler(Compiler): def get_dependency_gen_args(self, outtarget, outfile): return ['-emit-dependencies'] + def depfile_for_object(self, objfile): + return os.path.splitext(objfile)[0] + '.' + self.get_depfile_suffix() + def get_depfile_suffix(self): return 'd' @@ -1562,6 +1568,9 @@ end program prog def get_module_outdir_args(self, path): return ['-J' + path] + def depfile_for_object(self, objfile): + return objfile + '.' + self.get_depfile_suffix() + def get_depfile_suffix(self): return 'd' diff --git a/ninjabackend.py b/ninjabackend.py index 7d72e0672..c8134d7a1 100644 --- a/ninjabackend.py +++ b/ninjabackend.py @@ -1269,7 +1269,7 @@ rule FORTRAN_DEP_HACK obj_basename = src_filename.replace('/', '_').replace('\\', '_') rel_obj = os.path.join(self.get_target_private_dir(target), obj_basename) rel_obj += '.' + self.environment.get_object_suffix() - dep_file = rel_obj + '.' + compiler.get_depfile_suffix() + dep_file = compiler.depfile_for_object(rel_obj) if self.environment.coredata.get_builtin_option('use_pch'): pchlist = target.get_pch(compiler.language) else: