Renamed UserStringArrayOption to UserArrayOption for short.

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

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

@ -110,7 +110,7 @@ class GnuCPPCompiler(GnuCompiler, CPPCompiler):
False)} False)}
if self.gcc_type == GCC_MINGW: if self.gcc_type == GCC_MINGW:
opts.update({ 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), }) gnu_winlibs), })
return opts return opts
@ -188,7 +188,7 @@ class VisualStudioCPPCompiler(VisualStudioCCompiler, CPPCompiler):
'C++ exception handling type.', 'C++ exception handling type.',
['none', 'a', 's', 'sc'], ['none', 'a', 's', 'sc'],
'sc'), 'sc'),
'cpp_winlibs': coredata.UserStringArrayOption('cpp_winlibs', 'cpp_winlibs': coredata.UserArrayOption('cpp_winlibs',
'Windows libs to link against.', 'Windows libs to link against.',
msvc_winlibs) msvc_winlibs)
} }

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

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

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

Loading…
Cancel
Save