Handle Fortran sources with dependencies to themselves.
This commit is contained in:
parent
f3d0778403
commit
1b830c907f
|
@ -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
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
project('selfdep', 'fortran')
|
||||
|
||||
e = executable('selfdep', 'selfdep.f90')
|
||||
test('selfdep', e)
|
|
@ -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
|
Loading…
Reference in New Issue