aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/compilers')
-rw-r--r--mesonbuild/compilers/c.py129
-rw-r--r--mesonbuild/compilers/compilers.py13
-rw-r--r--mesonbuild/compilers/cpp.py233
-rw-r--r--mesonbuild/compilers/fortran.py36
4 files changed, 261 insertions, 150 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py
index eba7131..1bc9e84 100644
--- a/mesonbuild/compilers/c.py
+++ b/mesonbuild/compilers/c.py
@@ -107,25 +107,32 @@ class ClangCCompiler(ClangCompiler, CCompiler):
if version_compare(self.version, self._C18_VERSION):
c_stds += ['c18']
g_stds += ['gnu18']
- opts.update({'c_std': coredata.UserComboOption('C language standard to use',
- ['none'] + c_stds + g_stds,
- 'none')})
+ opts.update({
+ 'std': coredata.UserComboOption(
+ 'C language standard to use',
+ ['none'] + c_stds + g_stds,
+ 'none',
+ ),
+ })
if self.info.is_windows() or self.info.is_cygwin():
opts.update({
- 'c_winlibs': coredata.UserArrayOption('Standard Win libraries to link against',
- gnu_winlibs), })
+ 'winlibs': coredata.UserArrayOption(
+ 'Standard Win libraries to link against',
+ gnu_winlibs,
+ ),
+ })
return opts
def get_option_compile_args(self, options):
args = []
- std = options['c_std']
+ std = options['std']
if std.value != 'none':
args.append('-std=' + std.value)
return args
def get_option_link_args(self, options):
if self.info.is_windows() or self.info.is_cygwin():
- return options['c_winlibs'].value[:]
+ return options['winlibs'].value[:]
return []
@@ -166,15 +173,18 @@ class ArmclangCCompiler(ArmclangCompiler, CCompiler):
def get_options(self):
opts = CCompiler.get_options(self)
- opts.update({'c_std': coredata.UserComboOption('C language standard to use',
- ['none', 'c90', 'c99', 'c11',
- 'gnu90', 'gnu99', 'gnu11'],
- 'none')})
+ opts.update({
+ 'std': coredata.UserComboOption(
+ 'C language standard to use',
+ ['none', 'c90', 'c99', 'c11', 'gnu90', 'gnu99', 'gnu11'],
+ 'none',
+ ),
+ })
return opts
def get_option_compile_args(self, options):
args = []
- std = options['c_std']
+ std = options['std']
if std.value != 'none':
args.append('-std=' + std.value)
return args
@@ -204,25 +214,32 @@ class GnuCCompiler(GnuCompiler, CCompiler):
if version_compare(self.version, v):
c_stds += ['c17', 'c18']
g_stds += ['gnu17', 'gnu18']
- opts.update({'c_std': coredata.UserComboOption('C language standard to use',
- ['none'] + c_stds + g_stds,
- 'none')})
+ opts.update({
+ 'std': coredata.UserComboOption(
+ 'C language standard to use',
+ ['none'] + c_stds + g_stds,
+ 'none',
+ ),
+ })
if self.info.is_windows() or self.info.is_cygwin():
opts.update({
- 'c_winlibs': coredata.UserArrayOption('Standard Win libraries to link against',
- gnu_winlibs), })
+ 'winlibs': coredata.UserArrayOption(
+ 'Standard Win libraries to link against',
+ gnu_winlibs,
+ ),
+ })
return opts
def get_option_compile_args(self, options):
args = []
- std = options['c_std']
+ std = options['std']
if std.value != 'none':
args.append('-std=' + std.value)
return args
def get_option_link_args(self, options):
if self.info.is_windows() or self.info.is_cygwin():
- return options['c_winlibs'].value[:]
+ return options['winlibs'].value[:]
return []
def get_pch_use_args(self, pch_dir, header):
@@ -248,11 +265,17 @@ class ElbrusCCompiler(GnuCCompiler, ElbrusCompiler):
# It does support some various ISO standards and c/gnu 90, 9x, 1x in addition to those which GNU CC supports.
def get_options(self):
opts = CCompiler.get_options(self)
- opts.update({'c_std': coredata.UserComboOption('C language standard to use',
- ['none', 'c89', 'c90', 'c9x', 'c99', 'c1x', 'c11',
- 'gnu89', 'gnu90', 'gnu9x', 'gnu99', 'gnu1x', 'gnu11',
- 'iso9899:2011', 'iso9899:1990', 'iso9899:199409', 'iso9899:1999'],
- 'none')})
+ opts.update({
+ 'std': coredata.UserComboOption(
+ 'C language standard to use',
+ [
+ 'none', 'c89', 'c90', 'c9x', 'c99', 'c1x', 'c11',
+ 'gnu89', 'gnu90', 'gnu9x', 'gnu99', 'gnu1x', 'gnu11',
+ 'iso9899:2011', 'iso9899:1990', 'iso9899:199409', 'iso9899:1999',
+ ],
+ 'none',
+ ),
+ })
return opts
# Elbrus C compiler does not have lchmod, but there is only linker warning, not compiler error.
@@ -285,14 +308,18 @@ class IntelCCompiler(IntelGnuLikeCompiler, CCompiler):
g_stds = ['gnu89', 'gnu99']
if version_compare(self.version, '>=16.0.0'):
c_stds += ['c11']
- opts.update({'c_std': coredata.UserComboOption('C language standard to use',
- ['none'] + c_stds + g_stds,
- 'none')})
+ opts.update({
+ 'std': coredata.UserComboOption(
+ 'C language standard to use',
+ ['none'] + c_stds + g_stds,
+ 'none',
+ ),
+ })
return opts
def get_option_compile_args(self, options):
args = []
- std = options['c_std']
+ std = options['std']
if std.value != 'none':
args.append('-std=' + std.value)
return args
@@ -304,12 +331,16 @@ class VisualStudioLikeCCompilerMixin:
def get_options(self):
opts = super().get_options()
- opts.update({'c_winlibs': coredata.UserArrayOption('Windows libs to link against.',
- msvc_winlibs)})
+ opts.update({
+ 'winlibs': coredata.UserArrayOption(
+ 'Windows libs to link against.',
+ msvc_winlibs,
+ ),
+ })
return opts
def get_option_link_args(self, options):
- return options['c_winlibs'].value[:]
+ return options['winlibs'].value[:]
class VisualStudioCCompiler(MSVCCompiler, VisualStudioLikeCCompilerMixin, CCompiler):
@@ -343,14 +374,18 @@ class IntelClCCompiler(IntelVisualStudioLikeCompiler, VisualStudioLikeCCompilerM
def get_options(self):
opts = super().get_options()
c_stds = ['none', 'c89', 'c99', 'c11']
- opts.update({'c_std': coredata.UserComboOption('C language standard to use',
- c_stds,
- 'none')})
+ opts.update({
+ 'std': coredata.UserComboOption(
+ 'C language standard to use',
+ c_stds,
+ 'none',
+ ),
+ })
return opts
def get_option_compile_args(self, options):
args = []
- std = options['c_std']
+ std = options['std']
if std.value == 'c89':
mlog.warning("ICL doesn't explicitly implement c89, setting the standard to 'none', which is close.", once=True)
elif std.value != 'none':
@@ -367,14 +402,18 @@ class ArmCCompiler(ArmCompiler, CCompiler):
def get_options(self):
opts = CCompiler.get_options(self)
- opts.update({'c_std': coredata.UserComboOption('C language standard to use',
- ['none', 'c90', 'c99'],
- 'none')})
+ opts.update({
+ 'std': coredata.UserComboOption(
+ 'C language standard to use',
+ ['none', 'c90', 'c99'],
+ 'none',
+ ),
+ })
return opts
def get_option_compile_args(self, options):
args = []
- std = options['c_std']
+ std = options['std']
if std.value != 'none':
args.append('--' + std.value)
return args
@@ -393,9 +432,13 @@ class CcrxCCompiler(CcrxCompiler, CCompiler):
def get_options(self):
opts = CCompiler.get_options(self)
- opts.update({'c_std': coredata.UserComboOption('C language standard to use',
- ['none', 'c89', 'c99'],
- 'none')})
+ opts.update({
+ 'std': coredata.UserComboOption(
+ 'C language standard to use',
+ ['none', 'c89', 'c99'],
+ 'none',
+ ),
+ })
return opts
def get_no_stdinc_args(self):
@@ -403,7 +446,7 @@ class CcrxCCompiler(CcrxCompiler, CCompiler):
def get_option_compile_args(self, options):
args = []
- std = options['c_std']
+ std = options['std']
if std.value == 'c89':
args.append('-lang=c')
elif std.value == 'c99':
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index 52b9592..3d3a503 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -1272,10 +1272,10 @@ def get_global_options(lang: str,
"""Retreive options that apply to all compilers for a given language."""
description = 'Extra arguments passed to the {}'.format(lang)
opts = {
- lang + '_args': coredata.UserArrayOption(
+ 'args': coredata.UserArrayOption(
description + ' compiler',
[], split_args=True, user_input=True, allow_dups=True),
- lang + '_link_args': coredata.UserArrayOption(
+ 'link_args': coredata.UserArrayOption(
description + ' linker',
[], split_args=True, user_input=True, allow_dups=True),
}
@@ -1288,12 +1288,13 @@ def get_global_options(lang: str,
comp.INVOKES_LINKER)
for k, o in opts.items():
- if k in properties:
+ user_k = lang + '_' + k
+ if user_k in properties:
# Get from configuration files.
- o.set_value(properties[k])
- elif k == lang + '_args':
+ o.set_value(properties[user_k])
+ elif k == 'args':
o.set_value(compile_args)
- elif k == lang + '_link_args':
+ elif k == 'link_args':
o.set_value(link_args)
return opts
diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py
index 9894cd3..d30017f 100644
--- a/mesonbuild/compilers/cpp.py
+++ b/mesonbuild/compilers/cpp.py
@@ -167,36 +167,45 @@ class ClangCPPCompiler(ClangCompiler, CPPCompiler):
def get_options(self):
opts = CPPCompiler.get_options(self)
- opts.update({'cpp_eh': coredata.UserComboOption('C++ exception handling type.',
- ['none', 'default', 'a', 's', 'sc'],
- 'default'),
- 'cpp_rtti': coredata.UserBooleanOption('Enable RTTI', True),
- 'cpp_std': coredata.UserComboOption('C++ language standard to use',
- ['none', 'c++98', 'c++03', 'c++11', 'c++14', 'c++17', 'c++1z', 'c++2a',
- 'gnu++11', 'gnu++14', 'gnu++17', 'gnu++1z', 'gnu++2a'],
- 'none')})
+ opts.update({
+ 'eh': coredata.UserComboOption(
+ 'C++ exception handling type.',
+ ['none', 'default', 'a', 's', 'sc'],
+ 'default',
+ ),
+ 'rtti': coredata.UserBooleanOption('Enable RTTI', True),
+ 'std': coredata.UserComboOption(
+ 'C++ language standard to use',
+ ['none', 'c++98', 'c++03', 'c++11', 'c++14', 'c++17', 'c++1z', 'c++2a',
+ 'gnu++11', 'gnu++14', 'gnu++17', 'gnu++1z', 'gnu++2a'],
+ 'none',
+ ),
+ })
if self.info.is_windows() or self.info.is_cygwin():
opts.update({
- 'cpp_winlibs': coredata.UserArrayOption('Standard Win libraries to link against',
- gnu_winlibs), })
+ 'winlibs': coredata.UserArrayOption(
+ 'Standard Win libraries to link against',
+ gnu_winlibs,
+ ),
+ })
return opts
def get_option_compile_args(self, options):
args = []
- std = options['cpp_std']
+ std = options['std']
if std.value != 'none':
args.append(self._find_best_cpp_std(std.value))
- non_msvc_eh_options(options['cpp_eh'].value, args)
+ non_msvc_eh_options(options['eh'].value, args)
- if not options['cpp_rtti'].value:
+ if not options['rtti'].value:
args.append('-fno-rtti')
return args
def get_option_link_args(self, options):
if self.info.is_windows() or self.info.is_cygwin():
- return options['cpp_winlibs'].value[:]
+ return options['winlibs'].value[:]
return []
def language_stdlib_only_link_flags(self):
@@ -220,7 +229,7 @@ class EmscriptenCPPCompiler(EmscriptenMixin, LinkerEnvVarsMixin, ClangCPPCompile
def get_option_compile_args(self, options):
args = []
- std = options['cpp_std']
+ std = options['std']
if std.value != 'none':
args.append(self._find_best_cpp_std(std.value))
return args
@@ -239,22 +248,30 @@ class ArmclangCPPCompiler(ArmclangCompiler, CPPCompiler):
def get_options(self):
opts = CPPCompiler.get_options(self)
- opts.update({'cpp_eh': coredata.UserComboOption('C++ exception handling type.',
- ['none', 'default', 'a', 's', 'sc'],
- 'default'),
- 'cpp_std': coredata.UserComboOption('C++ language standard to use',
- ['none', 'c++98', 'c++03', 'c++11', 'c++14', 'c++17',
- 'gnu++98', 'gnu++03', 'gnu++11', 'gnu++14', 'gnu++17'],
- 'none')})
+ opts.update({
+ 'eh': coredata.UserComboOption(
+ 'C++ exception handling type.',
+ ['none', 'default', 'a', 's', 'sc'],
+ 'default',
+ ),
+ 'std': coredata.UserComboOption(
+ 'C++ language standard to use',
+ [
+ 'none', 'c++98', 'c++03', 'c++11', 'c++14', 'c++17',
+ 'gnu++98', 'gnu++03', 'gnu++11', 'gnu++14', 'gnu++17',
+ ],
+ 'none',
+ ),
+ })
return opts
def get_option_compile_args(self, options):
args = []
- std = options['cpp_std']
+ std = options['std']
if std.value != 'none':
args.append('-std=' + std.value)
- non_msvc_eh_options(options['cpp_eh'].value, args)
+ non_msvc_eh_options(options['eh'].value, args)
return args
@@ -275,40 +292,51 @@ class GnuCPPCompiler(GnuCompiler, CPPCompiler):
def get_options(self):
opts = CPPCompiler.get_options(self)
- opts.update({'cpp_eh': coredata.UserComboOption('C++ exception handling type.',
- ['none', 'default', 'a', 's', 'sc'],
- 'default'),
- 'cpp_rtti': coredata.UserBooleanOption('Enable RTTI', True),
- 'cpp_std': coredata.UserComboOption('C++ language standard to use',
- ['none', 'c++98', 'c++03', 'c++11', 'c++14', 'c++17', 'c++1z', 'c++2a',
- 'gnu++03', 'gnu++11', 'gnu++14', 'gnu++17', 'gnu++1z', 'gnu++2a'],
- 'none'),
- 'cpp_debugstl': coredata.UserBooleanOption('STL debug mode',
- False)})
+ opts.update({
+ 'eh': coredata.UserComboOption(
+ 'C++ exception handling type.',
+ ['none', 'default', 'a', 's', 'sc'],
+ 'default',
+ ),
+ 'rtti': coredata.UserBooleanOption('Enable RTTI', True),
+ 'std': coredata.UserComboOption(
+ 'C++ language standard to use',
+ ['none', 'c++98', 'c++03', 'c++11', 'c++14', 'c++17', 'c++1z', 'c++2a',
+ 'gnu++03', 'gnu++11', 'gnu++14', 'gnu++17', 'gnu++1z', 'gnu++2a'],
+ 'none',
+ ),
+ 'debugstl': coredata.UserBooleanOption(
+ 'STL debug mode',
+ False,
+ )
+ })
if self.info.is_windows() or self.info.is_cygwin():
opts.update({
- 'cpp_winlibs': coredata.UserArrayOption('Standard Win libraries to link against',
- gnu_winlibs), })
+ 'winlibs': coredata.UserArrayOption(
+ 'Standard Win libraries to link against',
+ gnu_winlibs,
+ ),
+ })
return opts
def get_option_compile_args(self, options):
args = []
- std = options['cpp_std']
+ std = options['std']
if std.value != 'none':
args.append(self._find_best_cpp_std(std.value))
- non_msvc_eh_options(options['cpp_eh'].value, args)
+ non_msvc_eh_options(options['eh'].value, args)
- if not options['cpp_rtti'].value:
+ if not options['rtti'].value:
args.append('-fno-rtti')
- if options['cpp_debugstl'].value:
+ if options['debugstl'].value:
args.append('-D_GLIBCXX_DEBUG=1')
return args
def get_option_link_args(self, options):
if self.info.is_windows() or self.info.is_cygwin():
- return options['cpp_winlibs'].value[:]
+ return options['winlibs'].value[:]
return []
def get_pch_use_args(self, pch_dir, header):
@@ -337,15 +365,25 @@ class ElbrusCPPCompiler(GnuCPPCompiler, ElbrusCompiler):
# It does not support c++/gnu++ 17 and 1z, but still does support 0x, 1y, and gnu++98.
def get_options(self):
opts = CPPCompiler.get_options(self)
- opts.update({'cpp_eh': coredata.UserComboOption('C++ exception handling type.',
- ['none', 'default', 'a', 's', 'sc'],
- 'default'),
- 'cpp_std': coredata.UserComboOption('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'),
- 'cpp_debugstl': coredata.UserBooleanOption('STL debug mode',
- False)})
+ opts.update({
+ 'eh': coredata.UserComboOption(
+ 'C++ exception handling type.',
+ ['none', 'default', 'a', 's', 'sc'],
+ 'default',
+ ),
+ 'std': coredata.UserComboOption(
+ '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',
+ ),
+ 'debugstl': coredata.UserBooleanOption(
+ 'STL debug mode',
+ False,
+ ),
+ })
return opts
# Elbrus C++ compiler does not have lchmod, but there is only linker warning, not compiler error.
@@ -361,13 +399,13 @@ class ElbrusCPPCompiler(GnuCPPCompiler, ElbrusCompiler):
# Elbrus C++ compiler does not support RTTI, so don't check for it.
def get_option_compile_args(self, options):
args = []
- std = options['cpp_std']
+ std = options['std']
if std.value != 'none':
args.append(self._find_best_cpp_std(std.value))
- non_msvc_eh_options(options['cpp_eh'].value, args)
+ non_msvc_eh_options(options['eh'].value, args)
- if options['cpp_debugstl'].value:
+ if options['debugstl'].value:
args.append('-D_GLIBCXX_DEBUG=1')
return args
@@ -400,31 +438,36 @@ class IntelCPPCompiler(IntelGnuLikeCompiler, CPPCompiler):
c_stds += ['c++17']
if version_compare(self.version, '>=17.0.0'):
g_stds += ['gnu++14']
- opts.update({'cpp_eh': coredata.UserComboOption('C++ exception handling type.',
- ['none', 'default', 'a', 's', 'sc'],
- 'default'),
- 'cpp_rtti': coredata.UserBooleanOption('Enable RTTI', True),
- 'cpp_std': coredata.UserComboOption('C++ language standard to use',
- ['none'] + c_stds + g_stds,
- 'none'),
- 'cpp_debugstl': coredata.UserBooleanOption('STL debug mode',
- False)})
+ opts.update({
+ 'eh': coredata.UserComboOption(
+ 'C++ exception handling type.',
+ ['none', 'default', 'a', 's', 'sc'],
+ 'default',
+ ),
+ 'rtti': coredata.UserBooleanOption('Enable RTTI', True),
+ 'std': coredata.UserComboOption(
+ 'C++ language standard to use',
+ ['none'] + c_stds + g_stds,
+ 'none',
+ ),
+ 'debugstl': coredata.UserBooleanOption('STL debug mode', False),
+ })
return opts
def get_option_compile_args(self, options):
args = []
- std = options['cpp_std']
+ std = options['std']
if std.value != 'none':
remap_cpp03 = {
'c++03': 'c++98',
'gnu++03': 'gnu++98'
}
args.append('-std=' + remap_cpp03.get(std.value, std.value))
- if options['cpp_eh'].value == 'none':
+ if options['eh'].value == 'none':
args.append('-fno-exceptions')
- if not options['cpp_rtti'].value:
+ if not options['rtti'].value:
args.append('-fno-rtti')
- if options['cpp_debugstl'].value:
+ if options['debugstl'].value:
args.append('-D_GLIBCXX_DEBUG=1')
return args
@@ -449,24 +492,32 @@ class VisualStudioLikeCPPCompilerMixin:
}
def get_option_link_args(self, options):
- return options['cpp_winlibs'].value[:]
+ return options['winlibs'].value[:]
def _get_options_impl(self, opts, cpp_stds: T.List[str]):
- opts.update({'cpp_eh': coredata.UserComboOption('C++ exception handling type.',
- ['none', 'default', 'a', 's', 'sc'],
- 'default'),
- 'cpp_rtti': coredata.UserBooleanOption('Enable RTTI', True),
- 'cpp_std': coredata.UserComboOption('C++ language standard to use',
- cpp_stds,
- 'none'),
- 'cpp_winlibs': coredata.UserArrayOption('Windows libs to link against.',
- msvc_winlibs)})
+ opts.update({
+ 'eh': coredata.UserComboOption(
+ 'C++ exception handling type.',
+ ['none', 'default', 'a', 's', 'sc'],
+ 'default',
+ ),
+ 'rtti': coredata.UserBooleanOption('Enable RTTI', True),
+ 'std': coredata.UserComboOption(
+ 'C++ language standard to use',
+ cpp_stds,
+ 'none',
+ ),
+ 'winlibs': coredata.UserArrayOption(
+ 'Windows libs to link against.',
+ msvc_winlibs,
+ ),
+ })
return opts
def get_option_compile_args(self, options):
args = []
- eh = options['cpp_eh']
+ eh = options['eh']
if eh.value == 'default':
args.append('/EHsc')
elif eh.value == 'none':
@@ -474,10 +525,10 @@ class VisualStudioLikeCPPCompilerMixin:
else:
args.append('/EH' + eh.value)
- if not options['cpp_rtti'].value:
+ if not options['rtti'].value:
args.append('/GR-')
- permissive, ver = self.VC_VERSION_MAP[options['cpp_std'].value]
+ permissive, ver = self.VC_VERSION_MAP[options['std'].value]
if ver is not None:
args.append('/std:c++{}'.format(ver))
@@ -504,17 +555,17 @@ class CPP11AsCPP14Mixin:
# which means setting the C++ standard version to C++14, in compilers that support it
# (i.e., after VS2015U3)
# if one is using anything before that point, one cannot set the standard.
- if options['cpp_std'].value in {'vc++11', 'c++11'}:
+ if options['std'].value in {'vc++11', 'c++11'}:
mlog.warning(self.id, 'does not support C++11;',
'attempting best effort; setting the standard to C++14', once=True)
# Don't mutate anything we're going to change, we need to use
# deepcopy since we're messing with members, and we can't simply
# copy the members because the option proxy doesn't support it.
options = copy.deepcopy(options)
- if options['cpp_std'].value == 'vc++11':
- options['cpp_std'].value = 'vc++14'
+ if options['std'].value == 'vc++11':
+ options['std'].value = 'vc++14'
else:
- options['cpp_std'].value = 'c++14'
+ options['std'].value = 'c++14'
return super().get_option_compile_args(options)
@@ -537,10 +588,10 @@ class VisualStudioCPPCompiler(CPP11AsCPP14Mixin, VisualStudioLikeCPPCompilerMixi
return self._get_options_impl(super().get_options(), cpp_stds)
def get_option_compile_args(self, options):
- if options['cpp_std'].value != 'none' and version_compare(self.version, '<19.00.24210'):
+ if options['std'].value != 'none' and version_compare(self.version, '<19.00.24210'):
mlog.warning('This version of MSVC does not support cpp_std arguments')
options = copy.copy(options)
- options['cpp_std'].value = 'none'
+ options['std'].value = 'none'
args = super().get_option_compile_args(options)
@@ -588,14 +639,18 @@ class ArmCPPCompiler(ArmCompiler, CPPCompiler):
def get_options(self):
opts = CPPCompiler.get_options(self)
- opts.update({'cpp_std': coredata.UserComboOption('C++ language standard to use',
- ['none', 'c++03', 'c++11'],
- 'none')})
+ opts.update({
+ 'std': coredata.UserComboOption(
+ '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']
+ std = options['std']
if std.value == 'c++11':
args.append('--cpp11')
elif std.value == 'c++03':
diff --git a/mesonbuild/compilers/fortran.py b/mesonbuild/compilers/fortran.py
index 16a93f5..01283a1 100644
--- a/mesonbuild/compilers/fortran.py
+++ b/mesonbuild/compilers/fortran.py
@@ -186,14 +186,18 @@ class GnuFortranCompiler(GnuCompiler, FortranCompiler):
fortran_stds += ['f2008']
if version_compare(self.version, '>=8.0.0'):
fortran_stds += ['f2018']
- opts.update({'fortran_std': coredata.UserComboOption('Fortran language standard to use',
- ['none'] + fortran_stds,
- 'none')})
+ opts.update({
+ 'std': coredata.UserComboOption(
+ 'Fortran language standard to use',
+ ['none'] + fortran_stds,
+ 'none',
+ ),
+ })
return opts
def get_option_compile_args(self, options) -> T.List[str]:
args = []
- std = options['fortran_std']
+ std = options['std']
if std.value != 'none':
args.append('-std=' + std.value)
return args
@@ -292,14 +296,18 @@ class IntelFortranCompiler(IntelGnuLikeCompiler, FortranCompiler):
def get_options(self):
opts = FortranCompiler.get_options(self)
fortran_stds = ['legacy', 'f95', 'f2003', 'f2008', 'f2018']
- opts.update({'fortran_std': coredata.UserComboOption('Fortran language standard to use',
- ['none'] + fortran_stds,
- 'none')})
+ opts.update({
+ 'std': coredata.UserComboOption(
+ 'Fortran language standard to use',
+ ['none'] + fortran_stds,
+ 'none',
+ ),
+ })
return opts
def get_option_compile_args(self, options) -> T.List[str]:
args = []
- std = options['fortran_std']
+ std = options['std']
stds = {'legacy': 'none', 'f95': 'f95', 'f2003': 'f03', 'f2008': 'f08', 'f2018': 'f18'}
if std.value != 'none':
args.append('-stand=' + stds[std.value])
@@ -342,14 +350,18 @@ class IntelClFortranCompiler(IntelVisualStudioLikeCompiler, FortranCompiler):
def get_options(self):
opts = FortranCompiler.get_options(self)
fortran_stds = ['legacy', 'f95', 'f2003', 'f2008', 'f2018']
- opts.update({'fortran_std': coredata.UserComboOption('Fortran language standard to use',
- ['none'] + fortran_stds,
- 'none')})
+ opts.update({
+ 'std': coredata.UserComboOption(
+ 'Fortran language standard to use',
+ ['none'] + fortran_stds,
+ 'none',
+ ),
+ })
return opts
def get_option_compile_args(self, options) -> T.List[str]:
args = []
- std = options['fortran_std']
+ std = options['std']
stds = {'legacy': 'none', 'f95': 'f95', 'f2003': 'f03', 'f2008': 'f08', 'f2018': 'f18'}
if std.value != 'none':
args.append('/stand:' + stds[std.value])