diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2018-04-15 17:18:44 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-15 17:18:44 +0300 |
commit | 86f725c1e523088c691432c608b3228499ca3c7b (patch) | |
tree | 30ee3be8b01895023d4a94d56f10000e11f1de10 /mesonbuild/compilers/cpp.py | |
parent | aff597fb99a77b8c1211e30f712f223d6d99587c (diff) | |
parent | dfac0ce8d7db2d445fab71410c37a4c3285ec45a (diff) | |
download | meson-86f725c1e523088c691432c608b3228499ca3c7b.zip meson-86f725c1e523088c691432c608b3228499ca3c7b.tar.gz meson-86f725c1e523088c691432c608b3228499ca3c7b.tar.bz2 |
Merge pull request #3115 from makise-homura/e2k-lcc-support
Support lcc compiler for e2k (Elbrus) architecture
Diffstat (limited to 'mesonbuild/compilers/cpp.py')
-rw-r--r-- | mesonbuild/compilers/cpp.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py index 1fa6f15..3804059 100644 --- a/mesonbuild/compilers/cpp.py +++ b/mesonbuild/compilers/cpp.py @@ -25,6 +25,7 @@ from .compilers import ( msvc_winlibs, ClangCompiler, GnuCompiler, + ElbrusCompiler, IntelCompiler, ) @@ -133,6 +134,29 @@ class GnuCPPCompiler(GnuCompiler, CPPCompiler): return ['-fpch-preprocess', '-include', os.path.basename(header)] +class ElbrusCPPCompiler(GnuCPPCompiler, ElbrusCompiler): + def __init__(self, exelist, version, gcc_type, is_cross, exe_wrapper=None, defines=None, **kwargs): + GnuCPPCompiler.__init__(self, exelist, version, gcc_type, is_cross, exe_wrapper, defines, **kwargs) + ElbrusCompiler.__init__(self, gcc_type, defines) + + # It does not support c++/gnu++ 17 and 1z, but still does support 0x, 1y, and gnu++98. + def get_options(self): + opts = super().get_options() + opts['cpp_std'] = coredata.UserComboOption('cpp_std', 'C++ language standard to use', + ['none', 'c++98', 'c++03', 'c++0x', 'c++11', 'c++14', 'c++1y', + 'gnu++98', 'gnu++03', 'gnu++0x', 'gnu++11', 'gnu++14', 'gnu++1y'], + 'none') + return opts + + # Elbrus C++ compiler does not have lchmod, but there is only linker warning, not compiler error. + # So we should explicitly fail at this case. + def has_function(self, funcname, prefix, env, extra_args=None, dependencies=None): + if funcname == 'lchmod': + return False + else: + return super().has_function(funcname, prefix, env, extra_args, dependencies) + + class IntelCPPCompiler(IntelCompiler, CPPCompiler): def __init__(self, exelist, version, icc_type, is_cross, exe_wrap, **kwargs): CPPCompiler.__init__(self, exelist, version, is_cross, exe_wrap, **kwargs) |