aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/c.py
diff options
context:
space:
mode:
authorPhillip Cao <ftechz@gmail.com>2018-10-25 15:24:05 +1300
committerPhillip Cao <ftechz@gmail.com>2018-11-08 00:02:22 +1300
commit68c83cb213ab3f17593699020313535d5de1e92f (patch)
treea7d1e78ca6d0f8fe1b1ad0e19bbac5e1d10039ec /mesonbuild/compilers/c.py
parent996f07c546d6e82b0648a1d9f81d7474b1bec76e (diff)
downloadmeson-68c83cb213ab3f17593699020313535d5de1e92f.zip
meson-68c83cb213ab3f17593699020313535d5de1e92f.tar.gz
meson-68c83cb213ab3f17593699020313535d5de1e92f.tar.bz2
Add support for Renesas CC-RX toolchain
Diffstat (limited to 'mesonbuild/compilers/c.py')
-rw-r--r--mesonbuild/compilers/c.py43
1 files changed, 43 insertions, 0 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py
index 35c71df..b57001a 100644
--- a/mesonbuild/compilers/c.py
+++ b/mesonbuild/compilers/c.py
@@ -46,6 +46,7 @@ from .compilers import (
ElbrusCompiler,
IntelCompiler,
RunResult,
+ CcrxCompiler,
)
gnu_compiler_internal_libs = ('m', 'c', 'pthread', 'dl', 'rt')
@@ -1584,3 +1585,45 @@ class ArmCCompiler(ArmCompiler, CCompiler):
if std.value != 'none':
args.append('--' + std.value)
return args
+
+class CcrxCCompiler(CcrxCompiler, CCompiler):
+ def __init__(self, exelist, version, compiler_type, is_cross, exe_wrapper=None, **kwargs):
+ CCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwargs)
+ CcrxCompiler.__init__(self, compiler_type)
+
+ # Override CCompiler.get_always_args
+ def get_always_args(self):
+ return ['-nologo']
+
+ def get_options(self):
+ opts = CCompiler.get_options(self)
+ opts.update({'c_std': coredata.UserComboOption('c_std', 'C language standard to use',
+ ['none', 'c89', 'c99'],
+ 'none')})
+ return opts
+
+ def get_option_compile_args(self, options):
+ args = []
+ std = options['c_std']
+ if std.value == 'c89':
+ args.append('-lang=c')
+ elif std.value == 'c99':
+ args.append('-lang=c99')
+ return args
+
+ def get_compile_only_args(self):
+ return []
+
+ def get_no_optimization_args(self):
+ return ['-optimize=0']
+
+ def get_output_args(self, target):
+ return ['-output=obj=%s' % target]
+
+ def get_linker_output_args(self, outputname):
+ return ['-output=%s' % outputname]
+
+ def get_include_args(self, path, is_system):
+ if path == '':
+ path = '.'
+ return ['-include=' + path]