summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Weißmann <volker.weissmann@gmx.de>2023-03-20 13:10:01 +0100
committerNirbheek Chauhan <nirbheek@centricular.com>2023-04-04 18:14:14 +0530
commit43039ae89c542b1298d8ce079cc949b1fc9d97f9 (patch)
tree982b8c8e7e2dec51585e1cd17519e3882df35fa0
parent113c6842b1bf49e43e92e2ec349d005bc8bcb6ee (diff)
downloadmeson-43039ae89c542b1298d8ce079cc949b1fc9d97f9.tar.gz
Add restat = 1 to the fortran_COMPILER rule
gfortran does not update the modification time of *.mod files. Fixes #11552
-rw-r--r--mesonbuild/backend/ninjabackend.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index 258fab4d0..c3fa7e1c5 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -2375,8 +2375,12 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485'''))
self.generate_cython_compile_rules(compiler)
return
crstr = self.get_rule_suffix(compiler.for_machine)
+ options = self._rsp_options(compiler)
if langname == 'fortran':
self.generate_fortran_dep_hack(crstr)
+ # gfortran does not update the modification time of *.mod files, therefore restat is needed.
+ # See also: https://github.com/ninja-build/ninja/pull/2275
+ options['extra'] = 'restat = 1'
rule = self.compiler_to_rule_name(compiler)
depargs = NinjaCommandArg.list(compiler.get_dependency_gen_args('$out', '$DEPFILE'), Quoting.none)
command = compiler.get_exelist()
@@ -2388,7 +2392,6 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485'''))
else:
deps = 'gcc'
depfile = '$DEPFILE'
- options = self._rsp_options(compiler)
self.add_rule(NinjaRule(rule, command, args, description, **options,
deps=deps, depfile=depfile))