From 68d29ef7f62df5481aa4de8eaf421f25243f4cb2 Mon Sep 17 00:00:00 2001 From: Andrew Lister Date: Fri, 20 Jun 2025 15:33:59 +0100 Subject: compilers-fortran: Fix preprocessing when fortran uses concat operator --- mesonbuild/compilers/fortran.py | 5 +++++ mesonbuild/compilers/mixins/gnu.py | 2 ++ 2 files changed, 7 insertions(+) (limited to 'mesonbuild/compilers') diff --git a/mesonbuild/compilers/fortran.py b/mesonbuild/compilers/fortran.py index 180a2dbfa..6f4f3d2c1 100644 --- a/mesonbuild/compilers/fortran.py +++ b/mesonbuild/compilers/fortran.py @@ -446,6 +446,11 @@ class IntelLLVMFortranCompiler(IntelFortranCompiler): id = 'intel-llvm' + def get_preprocess_only_args(self) -> T.List[str]: + return ['-preprocess-only'] + + def get_dependency_gen_args(self, outtarget: str, outfile: str) -> T.List[str]: + return [] class IntelClFortranCompiler(IntelVisualStudioLikeCompiler, FortranCompiler): diff --git a/mesonbuild/compilers/mixins/gnu.py b/mesonbuild/compilers/mixins/gnu.py index 9ea591e04..ddcd14a15 100644 --- a/mesonbuild/compilers/mixins/gnu.py +++ b/mesonbuild/compilers/mixins/gnu.py @@ -534,6 +534,8 @@ class GnuLikeCompiler(Compiler, metaclass=abc.ABCMeta): # We want to allow preprocessing files with any extension, such as # foo.c.in. In that case we need to tell GCC/CLANG to treat them as # assembly file. + if self.language == 'fortran': + return self.get_preprocess_only_args() lang = gnu_lang_map.get(self.language, 'assembler-with-cpp') return self.get_preprocess_only_args() + [f'-x{lang}'] -- cgit v1.2.3