From 540fd2f0e03f949842513a8fbb1ef86c33608fd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A1lint=20Aradi?= Date: Fri, 12 May 2017 14:34:19 +0200 Subject: Fix scanning of Fortran sources created during configuration --- mesonbuild/backend/ninjabackend.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'mesonbuild/backend') diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 797fb64..e5af9fd 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -1693,12 +1693,13 @@ rule FORTRAN_DEP_HACK modre = re.compile(r"\s*module\s+(\w+)", re.IGNORECASE) module_files = {} for s in target.get_sources(): - # FIXME, does not work for generated Fortran sources, - # but those are really rare. I hope. + # FIXME, does not work for Fortran sources generated by + # custom_target() and generator() as those are run after + # the configuration (configure_file() is OK) if not compiler.can_compile(s): continue - filename = os.path.join(self.environment.get_source_dir(), - s.subdir, s.fname) + filename = s.absolute_path(self.environment.get_source_dir(), + self.environment.get_build_dir()) with open(filename) as f: for line in f: modmatch = modre.match(line) -- cgit v1.1