From ebbaeec51b5c5c8177fe6583a2a5bd6b7f929684 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Sun, 23 Oct 2022 11:28:42 +0200 Subject: gnulike: Fix preprocessing files with any extension --- mesonbuild/compilers/mixins/gnu.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'mesonbuild/compilers/mixins/gnu.py') diff --git a/mesonbuild/compilers/mixins/gnu.py b/mesonbuild/compilers/mixins/gnu.py index 11efcc9..eb1c534 100644 --- a/mesonbuild/compilers/mixins/gnu.py +++ b/mesonbuild/compilers/mixins/gnu.py @@ -318,6 +318,12 @@ class GnuLikeCompiler(Compiler, metaclass=abc.ABCMeta): def get_coverage_args(self) -> T.List[str]: return ['--coverage'] + def get_preprocess_to_file_args(self) -> T.List[str]: + # 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. + return self.get_preprocess_only_args() + ['-x', 'assembler-with-cpp'] + class GnuCompiler(GnuLikeCompiler): """ -- cgit v1.1