summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/cpp.py
diff options
context:
space:
mode:
authorLiza Chevalier <lizalc@pm.me>2025-10-29 11:17:00 -0500
committerDylan Baker <dylan@pnwbakers.com>2025-10-29 12:35:55 -0700
commitba860d72a96932608bb2b13a2f32ebda0087905a (patch)
treed40fb1da7ea242673c6f7896c70be6ed12d6416e /mesonbuild/compilers/cpp.py
parente9d255de1580235fff96e110001ce4293006caaa (diff)
downloadmeson-ba860d72a96932608bb2b13a2f32ebda0087905a.tar.gz
compilers: add Microchip XC32 compiler
The Microchip XC32 compiler is a GCC-based compiler implemented using existing GNU compiler classes. As the XC32 version and GCC version do not match mixins have been implemented to override versions used in versions checks where applicable.
Diffstat (limited to 'mesonbuild/compilers/cpp.py')
-rw-r--r--mesonbuild/compilers/cpp.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py
index 8533373a8..b57cbec62 100644
--- a/mesonbuild/compilers/cpp.py
+++ b/mesonbuild/compilers/cpp.py
@@ -32,6 +32,7 @@ from .mixins.pgi import PGICompiler
from .mixins.emscripten import EmscriptenMixin
from .mixins.metrowerks import MetrowerksCompiler
from .mixins.metrowerks import mwccarm_instruction_set_args, mwcceppc_instruction_set_args
+from .mixins.microchip import Xc32Compiler, Xc32CPPStds
if T.TYPE_CHECKING:
from ..options import MutableKeyedOptionDictType
@@ -158,7 +159,7 @@ class CPPCompiler(CLikeCompiler, Compiler):
}
# Currently, remapping is only supported for Clang, Elbrus and GCC
- assert self.id in frozenset(['clang', 'lcc', 'gcc', 'emscripten', 'armltdclang', 'intel-llvm', 'nvidia_hpc'])
+ assert self.id in frozenset(['clang', 'lcc', 'gcc', 'emscripten', 'armltdclang', 'intel-llvm', 'nvidia_hpc', 'xc32-gcc'])
if cpp_std not in CPP_FALLBACKS:
# 'c++03' and 'c++98' don't have fallback types
@@ -1128,3 +1129,17 @@ class MetrowerksCPPCompilerEmbeddedPowerPC(MetrowerksCompiler, CPPCompiler):
if std != 'none':
args.append('-lang ' + std)
return args
+
+
+class Xc32CPPCompiler(Xc32CPPStds, Xc32Compiler, GnuCPPCompiler):
+
+ """Microchip XC32 C++ compiler."""
+
+ def __init__(self, ccache: T.List[str], exelist: T.List[str], version: str, for_machine: MachineChoice, is_cross: bool,
+ info: MachineInfo,
+ linker: T.Optional[DynamicLinker] = None,
+ defines: T.Optional[T.Dict[str, str]] = None,
+ full_version: T.Optional[str] = None):
+ GnuCPPCompiler.__init__(self, ccache, exelist, version, for_machine, is_cross,
+ info, linker=linker, full_version=full_version, defines=defines)
+ Xc32Compiler.__init__(self)