From a2ee76228e29f4cf5f52197dd2a726620445c81b Mon Sep 17 00:00:00 2001 From: "Bedarkar, Malhar" Date: Mon, 5 Mar 2018 18:26:39 -0600 Subject: First cut of ARMCC support for MESON. Change-Id: I15d8258e84d392baaccb8f670e33eefcfe8cd49a --- mesonbuild/compilers/__init__.py | 3 +++ mesonbuild/compilers/c.py | 57 +++++++++++++++++++++++++++++++++++++++ mesonbuild/compilers/compilers.py | 51 +++++++++++++++++++++++++++++++++++ 3 files changed, 111 insertions(+) (limited to 'mesonbuild/compilers') diff --git a/mesonbuild/compilers/__init__.py b/mesonbuild/compilers/__init__.py index 84c87fb..a0ec469 100644 --- a/mesonbuild/compilers/__init__.py +++ b/mesonbuild/compilers/__init__.py @@ -41,6 +41,8 @@ __all__ = [ 'sanitizer_compile_args', 'sort_clike', + 'ARMCompiler', + 'ARMCCompiler', 'CCompiler', 'ClangCCompiler', 'ClangCompiler', @@ -115,6 +117,7 @@ from .compilers import ( IntelCompiler, ) from .c import ( + ARMCCompiler, CCompiler, ClangCCompiler, GnuCCompiler, diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py index 1c9b9b4..cc1a48e 100644 --- a/mesonbuild/compilers/c.py +++ b/mesonbuild/compilers/c.py @@ -31,6 +31,7 @@ from .compilers import ( msvc_winlibs, vs32_instruction_set_args, vs64_instruction_set_args, + ARMCompiler, ClangCompiler, Compiler, CompilerArgs, @@ -888,6 +889,62 @@ class GnuCCompiler(GnuCompiler, CCompiler): return ['-fpch-preprocess', '-include', os.path.basename(header)] +class ARMCCompiler(ARMCompiler, CCompiler): + def __init__(self, exelist, version, is_cross, exe_wrapper=None, defines=None, **kwargs): + CCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwargs) + ARMCompiler.__init__(self, defines) + + def sanity_check_impl(self, work_dir, environment, sname, code): + mlog.debug('Sanity testing disabled for armcc compiler') + return + + def get_options(self): + opts = {'c_std': coredata.UserComboOption('c_std', 'C language standard to use', + ['none', 'c89', 'c99', 'c11'], + 'none')} + return opts + + def get_warn_args(self, level): + # ARMCC doesn't have warning levels + return [] + + def get_coverage_args(self): + return [] + + def get_coverage_link_args(self): + return [] + + # Override CCompiler.get_always_args + def get_always_args(self): + return [] + + def get_option_compile_args(self, options): + return [] + + def get_linker_exelist(self): + args = ['armlink'] + return args + + # Override CCompiler.get_dependency_gen_args + def get_dependency_gen_args(self, outtarget, outfile): + return [] + + # Override CCompiler.get_std_shared_lib_link_args + def get_std_shared_lib_link_args(self): + return [] + + def get_pch_use_args(self, pch_dir, header): + # FIXME: Add required arguments + # NOTE from armcc user guide: + # "Support for Precompiled Header (PCH) files is deprecated from ARM Compiler 5.05 + # onwards on all platforms. Note that ARM Compiler on Windows 8 never supported + # PCH files." + return [] + + def get_compile_only_args(self): + return ['-c'] + + class IntelCCompiler(IntelCompiler, CCompiler): def __init__(self, exelist, version, icc_type, is_cross, exe_wrapper=None, **kwargs): CCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwargs) diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 034fef4..cdc6f87 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -112,6 +112,12 @@ gnulike_buildtype_args = {'plain': [], 'debugoptimized': ['-O2', '-g'], 'release': ['-O3'], 'minsize': ['-Os', '-g']} +arm_buildtype_args = {'plain': [], + 'debug': ['-O0', '-g'], + 'debugoptimized': ['-O2', '-g'], + 'release': ['-O2'], + 'minsize': ['-Os', '-g'], + } msvc_buildtype_args = {'plain': [], 'debug': ["/MDd", "/ZI", "/Ob0", "/Od", "/RTC1"], @@ -133,6 +139,12 @@ gnulike_buildtype_linker_args = {'plain': [], 'release': ['-Wl,-O1'], 'minsize': [], } +arm_buildtype_linker_args = {'plain': [], + 'debug': [], + 'debugoptimized': [], + 'release': [], + 'minsize': [], + } msvc_buildtype_linker_args = {'plain': [], 'debug': [], @@ -657,6 +669,12 @@ class Compiler: def get_always_args(self): return [] + def can_linker_accept_rsp(self): + """ + Determines whether the linker can accept arguments using the @rsp syntax. + """ + return mesonlib.is_windows() + def get_linker_always_args(self): return [] @@ -1075,6 +1093,39 @@ class GnuCompiler: def get_default_include_dirs(self): return gnulike_default_include_dirs(self.exelist, self.language) +class ARMCompiler: + # Functionality that is common to all ARM family compilers. + def __init__(self, defines): + self.id = 'arm' + self.defines = defines or {} + self.base_options = ['b_pch', 'b_lto', 'b_pgo', 'b_sanitize', 'b_coverage', + 'b_colorout', 'b_ndebug', 'b_staticpic'] + # Assembly + self.can_compile_suffixes.add('s') + + def can_linker_accept_rsp(self): + return False + + def get_pic_args(self): + # FIXME: Add /ropi, /rwpi, /fpic etc. qualifiers to --apcs + return [] + + def get_buildtype_args(self, buildtype): + return arm_buildtype_args[buildtype] + + def get_buildtype_linker_args(self, buildtype): + return arm_buildtype_linker_args[buildtype] + + def get_pch_suffix(self): + # NOTE from armcc user guide: + # "Support for Precompiled Header (PCH) files is deprecated from ARM Compiler 5.05 + # onwards on all platforms. Note that ARM Compiler on Windows 8 never supported + # PCH files." + return 'pch' + + def split_shlib_to_parts(self, fname): + return os.path.split(fname)[0], fname + class ClangCompiler: def __init__(self, clang_type): -- cgit v1.1 From a470835778b4a9813e8a6046e04a958755797347 Mon Sep 17 00:00:00 2001 From: Somasekhar Penugonda Date: Tue, 6 Mar 2018 14:19:16 +0530 Subject: Meson Github pull request - 3186 requested changes - Fixing flake8 error in compilers.py - [E124] closing bracket does not match visual indentation - Updating ARMCCompiler constructor in c.py to raise error as per comments --- mesonbuild/compilers/c.py | 3 +++ mesonbuild/compilers/compilers.py | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'mesonbuild/compilers') diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py index cc1a48e..01f76ef 100644 --- a/mesonbuild/compilers/c.py +++ b/mesonbuild/compilers/c.py @@ -891,6 +891,9 @@ class GnuCCompiler(GnuCompiler, CCompiler): class ARMCCompiler(ARMCompiler, CCompiler): def __init__(self, exelist, version, is_cross, exe_wrapper=None, defines=None, **kwargs): + # ARMCC is only a cross compiler + if not is_cross: + raise EnvironmentException('armcc supports only cross-compilation.') CCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwargs) ARMCompiler.__init__(self, defines) diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index cdc6f87..47e3daa 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -112,12 +112,13 @@ gnulike_buildtype_args = {'plain': [], 'debugoptimized': ['-O2', '-g'], 'release': ['-O3'], 'minsize': ['-Os', '-g']} + arm_buildtype_args = {'plain': [], 'debug': ['-O0', '-g'], 'debugoptimized': ['-O2', '-g'], 'release': ['-O2'], 'minsize': ['-Os', '-g'], - } + } msvc_buildtype_args = {'plain': [], 'debug': ["/MDd", "/ZI", "/Ob0", "/Od", "/RTC1"], @@ -139,12 +140,13 @@ gnulike_buildtype_linker_args = {'plain': [], 'release': ['-Wl,-O1'], 'minsize': [], } + arm_buildtype_linker_args = {'plain': [], 'debug': [], 'debugoptimized': [], 'release': [], 'minsize': [], - } + } msvc_buildtype_linker_args = {'plain': [], 'debug': [], -- cgit v1.1 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/__init__.py | 2 ++ mesonbuild/compilers/c.py | 20 -------------------- mesonbuild/compilers/compilers.py | 34 ++++++++++++++++++++++++++++++---- mesonbuild/compilers/cpp.py | 30 ++++++++++++++++++++++++++++++ 4 files changed, 62 insertions(+), 24 deletions(-) (limited to 'mesonbuild/compilers') diff --git a/mesonbuild/compilers/__init__.py b/mesonbuild/compilers/__init__.py index a0ec469..e58a604 100644 --- a/mesonbuild/compilers/__init__.py +++ b/mesonbuild/compilers/__init__.py @@ -43,6 +43,7 @@ __all__ = [ 'ARMCompiler', 'ARMCCompiler', + 'ARMCPPCompiler', 'CCompiler', 'ClangCCompiler', 'ClangCompiler', @@ -125,6 +126,7 @@ from .c import ( VisualStudioCCompiler, ) from .cpp import ( + ARMCPPCompiler, CPPCompiler, ClangCPPCompiler, GnuCPPCompiler, diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py index 01f76ef..a77842c 100644 --- a/mesonbuild/compilers/c.py +++ b/mesonbuild/compilers/c.py @@ -917,10 +917,6 @@ class ARMCCompiler(ARMCompiler, CCompiler): def get_coverage_link_args(self): return [] - # Override CCompiler.get_always_args - def get_always_args(self): - return [] - def get_option_compile_args(self, options): return [] @@ -928,22 +924,6 @@ class ARMCCompiler(ARMCompiler, CCompiler): args = ['armlink'] return args - # Override CCompiler.get_dependency_gen_args - def get_dependency_gen_args(self, outtarget, outfile): - return [] - - # Override CCompiler.get_std_shared_lib_link_args - def get_std_shared_lib_link_args(self): - return [] - - def get_pch_use_args(self, pch_dir, header): - # FIXME: Add required arguments - # NOTE from armcc user guide: - # "Support for Precompiled Header (PCH) files is deprecated from ARM Compiler 5.05 - # onwards on all platforms. Note that ARM Compiler on Windows 8 never supported - # PCH files." - return [] - def get_compile_only_args(self): return ['-c'] diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 47e3daa..556d881 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -114,10 +114,10 @@ gnulike_buildtype_args = {'plain': [], 'minsize': ['-Os', '-g']} arm_buildtype_args = {'plain': [], - 'debug': ['-O0', '-g'], - 'debugoptimized': ['-O2', '-g'], - 'release': ['-O2'], - 'minsize': ['-Os', '-g'], + 'debug': ['-O0', '--debug'], + 'debugoptimized': ['-O1', '--debug'], + 'release': ['-O3', '-Otime'], + 'minsize': ['-O3', '-Ospace'], } msvc_buildtype_args = {'plain': [], @@ -1118,6 +1118,26 @@ class ARMCompiler: def get_buildtype_linker_args(self, buildtype): return arm_buildtype_linker_args[buildtype] + # Override CCompiler.get_always_args + def get_always_args(self): + return [] + + # Override CCompiler.get_dependency_gen_args + def get_dependency_gen_args(self, outtarget, outfile): + return [] + + # Override CCompiler.get_std_shared_lib_link_args + def get_std_shared_lib_link_args(self): + return [] + + def get_pch_use_args(self, pch_dir, header): + # FIXME: Add required arguments + # NOTE from armcc user guide: + # "Support for Precompiled Header (PCH) files is deprecated from ARM Compiler 5.05 + # onwards on all platforms. Note that ARM Compiler on Windows 8 never supported + # PCH files." + return [] + def get_pch_suffix(self): # NOTE from armcc user guide: # "Support for Precompiled Header (PCH) files is deprecated from ARM Compiler 5.05 @@ -1128,6 +1148,12 @@ class ARMCompiler: def split_shlib_to_parts(self, fname): return os.path.split(fname)[0], fname + def thread_flags(self, env): + return [] + + def thread_link_flags(self, env): + return [] + class ClangCompiler: def __init__(self, clang_type): 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/__init__.py | 7 +-- mesonbuild/compilers/c.py | 60 ++++++------------ mesonbuild/compilers/compilers.py | 129 +++++++++++++++++++++----------------- mesonbuild/compilers/cpp.py | 58 +++++++++-------- 4 files changed, 120 insertions(+), 134 deletions(-) (limited to 'mesonbuild/compilers') diff --git a/mesonbuild/compilers/__init__.py b/mesonbuild/compilers/__init__.py index e58a604..55276d9 100644 --- a/mesonbuild/compilers/__init__.py +++ b/mesonbuild/compilers/__init__.py @@ -41,9 +41,6 @@ __all__ = [ 'sanitizer_compile_args', 'sort_clike', - 'ARMCompiler', - 'ARMCCompiler', - 'ARMCPPCompiler', 'CCompiler', 'ClangCCompiler', 'ClangCompiler', @@ -118,7 +115,7 @@ from .compilers import ( IntelCompiler, ) from .c import ( - ARMCCompiler, + ArmCCompiler, CCompiler, ClangCCompiler, GnuCCompiler, @@ -126,7 +123,7 @@ from .c import ( VisualStudioCCompiler, ) from .cpp import ( - ARMCPPCompiler, + ArmCPPCompiler, CPPCompiler, ClangCPPCompiler, GnuCPPCompiler, diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py index a77842c..8884548 100644 --- a/mesonbuild/compilers/c.py +++ b/mesonbuild/compilers/c.py @@ -31,7 +31,7 @@ from .compilers import ( msvc_winlibs, vs32_instruction_set_args, vs64_instruction_set_args, - ARMCompiler, + ArmCompiler, ClangCompiler, Compiler, CompilerArgs, @@ -889,45 +889,6 @@ class GnuCCompiler(GnuCompiler, CCompiler): return ['-fpch-preprocess', '-include', os.path.basename(header)] -class ARMCCompiler(ARMCompiler, CCompiler): - def __init__(self, exelist, version, is_cross, exe_wrapper=None, defines=None, **kwargs): - # ARMCC is only a cross compiler - if not is_cross: - raise EnvironmentException('armcc supports only cross-compilation.') - CCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwargs) - ARMCompiler.__init__(self, defines) - - def sanity_check_impl(self, work_dir, environment, sname, code): - mlog.debug('Sanity testing disabled for armcc compiler') - return - - def get_options(self): - opts = {'c_std': coredata.UserComboOption('c_std', 'C language standard to use', - ['none', 'c89', 'c99', 'c11'], - 'none')} - return opts - - def get_warn_args(self, level): - # ARMCC doesn't have warning levels - return [] - - def get_coverage_args(self): - return [] - - def get_coverage_link_args(self): - return [] - - def get_option_compile_args(self, options): - return [] - - def get_linker_exelist(self): - args = ['armlink'] - return args - - def get_compile_only_args(self): - return ['-c'] - - class IntelCCompiler(IntelCompiler, CCompiler): def __init__(self, exelist, version, icc_type, is_cross, exe_wrapper=None, **kwargs): CCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwargs) @@ -1206,3 +1167,22 @@ class VisualStudioCCompiler(CCompiler): if 'INCLUDE' not in os.environ: return [] return os.environ['INCLUDE'].split(os.pathsep) + + +class ArmCCompiler(ArmCompiler, CCompiler): + def __init__(self, exelist, version, is_cross, exe_wrapper=None, **kwargs): + CCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwargs) + ArmCompiler.__init__(self) + + def get_options(self): + opts = {'c_std': coredata.UserComboOption('c_std', 'C language standard to use', + ['none', 'c90', 'c99'], + 'none')} + return opts + + def get_option_compile_args(self, options): + args = [] + std = options['c_std'] + if std.value != 'none': + args.append('--' + std.value) + return args diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 556d881..966e205 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -1095,65 +1095,6 @@ class GnuCompiler: def get_default_include_dirs(self): return gnulike_default_include_dirs(self.exelist, self.language) -class ARMCompiler: - # Functionality that is common to all ARM family compilers. - def __init__(self, defines): - self.id = 'arm' - self.defines = defines or {} - self.base_options = ['b_pch', 'b_lto', 'b_pgo', 'b_sanitize', 'b_coverage', - 'b_colorout', 'b_ndebug', 'b_staticpic'] - # Assembly - self.can_compile_suffixes.add('s') - - def can_linker_accept_rsp(self): - return False - - def get_pic_args(self): - # FIXME: Add /ropi, /rwpi, /fpic etc. qualifiers to --apcs - return [] - - def get_buildtype_args(self, buildtype): - return arm_buildtype_args[buildtype] - - def get_buildtype_linker_args(self, buildtype): - return arm_buildtype_linker_args[buildtype] - - # Override CCompiler.get_always_args - def get_always_args(self): - return [] - - # Override CCompiler.get_dependency_gen_args - def get_dependency_gen_args(self, outtarget, outfile): - return [] - - # Override CCompiler.get_std_shared_lib_link_args - def get_std_shared_lib_link_args(self): - return [] - - def get_pch_use_args(self, pch_dir, header): - # FIXME: Add required arguments - # NOTE from armcc user guide: - # "Support for Precompiled Header (PCH) files is deprecated from ARM Compiler 5.05 - # onwards on all platforms. Note that ARM Compiler on Windows 8 never supported - # PCH files." - return [] - - def get_pch_suffix(self): - # NOTE from armcc user guide: - # "Support for Precompiled Header (PCH) files is deprecated from ARM Compiler 5.05 - # onwards on all platforms. Note that ARM Compiler on Windows 8 never supported - # PCH files." - return 'pch' - - def split_shlib_to_parts(self, fname): - return os.path.split(fname)[0], fname - - def thread_flags(self, env): - return [] - - def thread_link_flags(self, env): - return [] - class ClangCompiler: def __init__(self, clang_type): @@ -1294,3 +1235,73 @@ class IntelCompiler: def get_default_include_dirs(self): return gnulike_default_include_dirs(self.exelist, self.language) + + +class ArmCompiler: + # Functionality that is common to all ARM family compilers. + def __init__(self): + if not self.is_cross: + raise EnvironmentException('armcc supports only cross-compilation.') + self.id = 'arm' + default_warn_args = [] + self.warn_args = {'1': default_warn_args, + '2': default_warn_args + [], + '3': default_warn_args + []} + # Assembly + self.can_compile_suffixes.add('s') + + def can_linker_accept_rsp(self): + return False + + def get_pic_args(self): + # FIXME: Add /ropi, /rwpi, /fpic etc. qualifiers to --apcs + return [] + + def get_buildtype_args(self, buildtype): + return arm_buildtype_args[buildtype] + + def get_buildtype_linker_args(self, buildtype): + return arm_buildtype_linker_args[buildtype] + + # Override CCompiler.get_always_args + def get_always_args(self): + return [] + + # Override CCompiler.get_dependency_gen_args + def get_dependency_gen_args(self, outtarget, outfile): + return [] + + # Override CCompiler.get_std_shared_lib_link_args + def get_std_shared_lib_link_args(self): + return [] + + def get_pch_use_args(self, pch_dir, header): + # FIXME: Add required arguments + # NOTE from armcc user guide: + # "Support for Precompiled Header (PCH) files is deprecated from ARM Compiler 5.05 + # onwards on all platforms. Note that ARM Compiler on Windows 8 never supported + # PCH files." + return [] + + def get_pch_suffix(self): + # NOTE from armcc user guide: + # "Support for Precompiled Header (PCH) files is deprecated from ARM Compiler 5.05 + # onwards on all platforms. Note that ARM Compiler on Windows 8 never supported + # PCH files." + return 'pch' + + def thread_flags(self, env): + return [] + + def thread_link_flags(self, env): + return [] + + def get_linker_exelist(self): + args = ['armlink'] + return args + + def get_coverage_args(self): + return [] + + def get_coverage_link_args(self): + return [] 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') 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