From 831d1e4c2e7b0ce8dfd0b2471bf2dab499181d66 Mon Sep 17 00:00:00 2001 From: "Bedarkar, Malhar" Date: Wed, 14 Mar 2018 22:42:06 -0500 Subject: - Updating cpp_std options similar to other compiler classes - Updating environment.py for selecting '--vsn' option for armcc only. - Updating build type arguments from GitHub pull request - 3157 Change-Id: Id3151e7715ec1016afdbd65391bb0d414ec7de13 --- mesonbuild/compilers/cpp.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'mesonbuild/compilers/cpp.py') diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py index 1fa6f15..15e8457 100644 --- a/mesonbuild/compilers/cpp.py +++ b/mesonbuild/compilers/cpp.py @@ -26,6 +26,7 @@ from .compilers import ( ClangCompiler, GnuCompiler, IntelCompiler, + ARMCompiler, ) class CPPCompiler(CCompiler): @@ -133,6 +134,35 @@ class GnuCPPCompiler(GnuCompiler, CPPCompiler): return ['-fpch-preprocess', '-include', os.path.basename(header)] +class ARMCPPCompiler(ARMCompiler, CPPCompiler): + def __init__(self, exelist, version, is_cross, exe_wrap=None, defines=None, **kwargs): + CPPCompiler.__init__(self, exelist, version, is_cross, exe_wrap, **kwargs) + ARMCompiler.__init__(self, defines) + default_warn_args = [] + self.warn_args = {'1': default_warn_args, + '2': default_warn_args + [], + '3': default_warn_args + []} + + def get_options(self): + opts = {'cpp_std': coredata.UserComboOption('cpp_std', 'C++ language standard to use', + ['none', 'c++11'], + 'none')} + return opts + + def get_option_compile_args(self, options): + args = [] + std = options['cpp_std'] + if std.value == 'c++11': + args.append('--cpp11') + return args + + def get_option_link_args(self, options): + return [] + + def get_compiler_check_args(self): + return [] + + 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) -- cgit v1.1 From e62b8109ebfef437a380f2d8cedd1565095a5574 Mon Sep 17 00:00:00 2001 From: Somasekhar Penugonda Date: Thu, 15 Mar 2018 18:33:11 +0530 Subject: Updates to CPP support and update review changes --- mesonbuild/compilers/cpp.py | 58 ++++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 30 deletions(-) (limited to 'mesonbuild/compilers/cpp.py') diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py index 15e8457..952f7f2 100644 --- a/mesonbuild/compilers/cpp.py +++ b/mesonbuild/compilers/cpp.py @@ -26,7 +26,7 @@ from .compilers import ( ClangCompiler, GnuCompiler, IntelCompiler, - ARMCompiler, + ArmCompiler, ) class CPPCompiler(CCompiler): @@ -134,35 +134,6 @@ class GnuCPPCompiler(GnuCompiler, CPPCompiler): return ['-fpch-preprocess', '-include', os.path.basename(header)] -class ARMCPPCompiler(ARMCompiler, CPPCompiler): - def __init__(self, exelist, version, is_cross, exe_wrap=None, defines=None, **kwargs): - CPPCompiler.__init__(self, exelist, version, is_cross, exe_wrap, **kwargs) - ARMCompiler.__init__(self, defines) - default_warn_args = [] - self.warn_args = {'1': default_warn_args, - '2': default_warn_args + [], - '3': default_warn_args + []} - - def get_options(self): - opts = {'cpp_std': coredata.UserComboOption('cpp_std', 'C++ language standard to use', - ['none', 'c++11'], - 'none')} - return opts - - def get_option_compile_args(self, options): - args = [] - std = options['cpp_std'] - if std.value == 'c++11': - args.append('--cpp11') - return args - - def get_option_link_args(self, options): - return [] - - def get_compiler_check_args(self): - return [] - - 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) @@ -245,3 +216,30 @@ class VisualStudioCPPCompiler(VisualStudioCCompiler, CPPCompiler): # Visual Studio C++ compiler doesn't support -fpermissive, # so just use the plain C args. return super(VisualStudioCCompiler, self).get_compiler_check_args() + + +class ArmCPPCompiler(ArmCompiler, CPPCompiler): + def __init__(self, exelist, version, is_cross, exe_wrap=None, defines=None, **kwargs): + CPPCompiler.__init__(self, exelist, version, is_cross, exe_wrap, **kwargs) + ArmCompiler.__init__(self, defines) + + def get_options(self): + opts = {'cpp_std': coredata.UserComboOption('cpp_std', 'C++ language standard to use', + ['none', 'c++03', 'c++11'], + 'none')} + return opts + + def get_option_compile_args(self, options): + args = [] + std = options['cpp_std'] + if std.value == 'c++11': + args.append('--cpp11') + elif std.value == 'c++03': + args.append('--cpp') + return args + + def get_option_link_args(self, options): + return [] + + def get_compiler_check_args(self): + return [] -- cgit v1.1 From 7f8908336362cccd45516f48b5320380cec0e817 Mon Sep 17 00:00:00 2001 From: Somasekhar Penugonda Date: Wed, 28 Mar 2018 15:11:45 +0530 Subject: Fix for issue in cpp.py Change-Id: Iad9623d20eb5086528dacefce5d2f4f9bb9d0312 --- mesonbuild/compilers/cpp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mesonbuild/compilers/cpp.py') diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py index 952f7f2..f6f5bba 100644 --- a/mesonbuild/compilers/cpp.py +++ b/mesonbuild/compilers/cpp.py @@ -219,9 +219,9 @@ class VisualStudioCPPCompiler(VisualStudioCCompiler, CPPCompiler): class ArmCPPCompiler(ArmCompiler, CPPCompiler): - def __init__(self, exelist, version, is_cross, exe_wrap=None, defines=None, **kwargs): + def __init__(self, exelist, version, is_cross, exe_wrap=None, **kwargs): CPPCompiler.__init__(self, exelist, version, is_cross, exe_wrap, **kwargs) - ArmCompiler.__init__(self, defines) + ArmCompiler.__init__(self) def get_options(self): opts = {'cpp_std': coredata.UserComboOption('cpp_std', 'C++ language standard to use', -- cgit v1.1