Handle Fortran sources with dependencies to themselves.

This commit is contained in:
Jussi Pakkanen 2014-08-08 14:29:20 +03:00
parent f3d0778403
commit 1b830c907f
3 changed files with 20 additions and 0 deletions

View File

@ -1012,6 +1012,11 @@ class NinjaBackend(backends.Backend):
raise InvalidArguments('Module %s in file %s not provided by any other source file.' %
(usename, src))
mod_source_file = tdeps[usename]
# Check if a source uses a module it exports itself.
# Potential bug if multiple targets have a file with
# the same name.
if mod_source_file == os.path.split(src)[1]:
continue
# WORKAROUND, we should set up a file level dependency to the
# module file and mark it as an output of this target. However
# we can't do that as Ninja does not support dependency tracking

View File

@ -0,0 +1,4 @@
project('selfdep', 'fortran')
e = executable('selfdep', 'selfdep.f90')
test('selfdep', e)

View File

@ -0,0 +1,11 @@
MODULE Circle
REAL, PARAMETER :: Pi = 3.1415927
REAL :: radius
END MODULE Circle
PROGRAM prog
use Circle
IMPLICIT NONE
END PROGRAM prog