diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 45b4a11a9..d61c3597c 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -2954,6 +2954,8 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485''')) def add_dependency_scanner_entries_to_element(self, target, compiler, element, src): if not self.should_use_dyndeps_for_target(target): return + if isinstance(target, build.CompileTarget): + return extension = os.path.splitext(src.fname)[1][1:] if extension != 'C': extension = extension.lower() diff --git a/test cases/fortran/22 preprocess/main.f90 b/test cases/fortran/22 preprocess/main.f90 new file mode 100644 index 000000000..7cbc11cec --- /dev/null +++ b/test cases/fortran/22 preprocess/main.f90 @@ -0,0 +1,4 @@ +#define MYDEF program +MYDEF foo + write (*,*) 'Hello, world!' +end MYDEF foo diff --git a/test cases/fortran/22 preprocess/meson.build b/test cases/fortran/22 preprocess/meson.build new file mode 100644 index 000000000..b776940a9 --- /dev/null +++ b/test cases/fortran/22 preprocess/meson.build @@ -0,0 +1,7 @@ +project('preprocess', 'fortran') + +fc = meson.get_compiler('fortran') + +pp_files = fc.preprocess('main.f90', output: '@PLAINNAME@') + +library('foo', pp_files)