Renamed UserStringArrayOption to UserArrayOption for short.

pull/2744/head
Jussi Pakkanen 7 years ago
parent c2d23dd678
commit 4ae0cadb7f
  1. 10
      mesonbuild/compilers/c.py
  2. 8
      mesonbuild/compilers/cpp.py
  3. 3
      mesonbuild/coredata.py
  4. 2
      mesonbuild/mintro.py
  5. 2
      mesonbuild/optinterpreter.py

@ -839,8 +839,8 @@ class GnuCCompiler(GnuCompiler, CCompiler):
'none')}
if self.gcc_type == GCC_MINGW:
opts.update({
'c_winlibs': coredata.UserStringArrayOption('c_winlibs', 'Standard Win libraries to link against',
gnu_winlibs), })
'c_winlibs': coredata.UserArrayOption('c_winlibs', 'Standard Win libraries to link against',
gnu_winlibs), })
return opts
def get_option_compile_args(self, options):
@ -1012,9 +1012,9 @@ class VisualStudioCCompiler(CCompiler):
return []
def get_options(self):
return {'c_winlibs': coredata.UserStringArrayOption('c_winlibs',
'Windows libs to link against.',
msvc_winlibs)
return {'c_winlibs': coredata.UserArrayOption('c_winlibs',
'Windows libs to link against.',
msvc_winlibs)
}
def get_option_link_args(self, options):

@ -110,7 +110,7 @@ class GnuCPPCompiler(GnuCompiler, CPPCompiler):
False)}
if self.gcc_type == GCC_MINGW:
opts.update({
'cpp_winlibs': coredata.UserStringArrayOption('cpp_winlibs', 'Standard Win libraries to link against',
'cpp_winlibs': coredata.UserArrayOption('cpp_winlibs', 'Standard Win libraries to link against',
gnu_winlibs), })
return opts
@ -188,9 +188,9 @@ class VisualStudioCPPCompiler(VisualStudioCCompiler, CPPCompiler):
'C++ exception handling type.',
['none', 'a', 's', 'sc'],
'sc'),
'cpp_winlibs': coredata.UserStringArrayOption('cpp_winlibs',
'Windows libs to link against.',
msvc_winlibs)
'cpp_winlibs': coredata.UserArrayOption('cpp_winlibs',
'Windows libs to link against.',
msvc_winlibs)
}
def get_option_compile_args(self, options):

@ -125,8 +125,7 @@ class UserComboOption(UserOption):
raise MesonException('Value %s not one of accepted values.' % value)
return value
class UserStringArrayOption(UserOption):
class UserArrayOption(UserOption):
def __init__(self, name, description, value, **kwargs):
super().__init__(name, description, kwargs.get('choices', []))
self.set_value(value, user_input=False)

@ -139,7 +139,7 @@ def add_keys(optlist, options):
elif isinstance(opt, coredata.UserComboOption):
optdict['choices'] = opt.choices
typestr = 'combo'
elif isinstance(opt, coredata.UserStringArrayOption):
elif isinstance(opt, coredata.UserArrayOption):
typestr = 'stringarray'
else:
raise RuntimeError("Unknown option type")

@ -99,7 +99,7 @@ def string_array_parser(name, description, kwargs):
value = kwargs.get('value', [])
if not isinstance(value, list):
raise OptionException('Array choices must be passed as an array.')
return coredata.UserStringArrayOption(name, description, value, choices=choices)
return coredata.UserArrayOption(name, description, value, choices=choices)
option_types = {'string': StringParser,
'boolean': BooleanParser,

Loading…
Cancel
Save