diff options
author | Volker-Weissmann <39418860+Volker-Weissmann@users.noreply.github.com> | 2021-05-19 16:10:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-19 17:10:22 +0300 |
commit | 4ca9a16288f51cce99624a2ef595d879acdc02d8 (patch) | |
tree | ac6d15bc04257135fb65927be64bc9eb0de9c140 /mesonbuild/compilers/compilers.py | |
parent | a6e9b54b1d2d16b723e9aefd8cf49558e68abdc3 (diff) | |
download | meson-4ca9a16288f51cce99624a2ef595d879acdc02d8.zip meson-4ca9a16288f51cce99624a2ef595d879acdc02d8.tar.gz meson-4ca9a16288f51cce99624a2ef595d879acdc02d8.tar.bz2 |
.C files are now treated as C++ code
Diffstat (limited to 'mesonbuild/compilers/compilers.py')
-rw-r--r-- | mesonbuild/compilers/compilers.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 9b4418b..231eca7 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -51,7 +51,7 @@ lib_suffixes = ('a', 'lib', 'dll', 'dll.a', 'dylib', 'so') # type: T.Tuple[str, # This means we can't include .h headers here since they could be C, C++, ObjC, etc. lang_suffixes = { 'c': ('c',), - 'cpp': ('cpp', 'cc', 'cxx', 'c++', 'hh', 'hpp', 'ipp', 'hxx', 'ino', 'ixx'), + 'cpp': ('cpp', 'cc', 'cxx', 'c++', 'hh', 'hpp', 'ipp', 'hxx', 'ino', 'ixx', 'C'), 'cuda': ('cu',), # f90, f95, f03, f08 are for free-form fortran ('f90' recommended) # f, for, ftn, fpp are for fixed-form fortran ('f' or 'for' recommended) @@ -510,7 +510,9 @@ class Compiler(metaclass=abc.ABCMeta): def can_compile(self, src: 'mesonlib.FileOrString') -> bool: if isinstance(src, mesonlib.File): src = src.fname - suffix = os.path.splitext(src)[1].lower() + suffix = os.path.splitext(src)[1] + if suffix != '.C': + suffix = suffix.lower() return bool(suffix) and suffix[1:] in self.can_compile_suffixes def get_id(self) -> str: |