movve insert_build_prefix to mconf

that's the only place it's used anyway.
pull/8080/head
Dylan Baker 4 years ago
parent b25a423a64
commit b37f0cce2c
  1. 7
      mesonbuild/coredata.py
  2. 10
      mesonbuild/mconf.py

@ -827,13 +827,6 @@ class CoreData:
for k1, v1 in v0.items():
yield (k0 + k1, v1)
@classmethod
def insert_build_prefix(cls, k):
idx = k.find(':')
if idx < 0:
return 'build.' + k
return k[:idx + 1] + 'build.' + k[idx + 1:]
@classmethod
def is_per_machine_option(cls, optname: OptionKey) -> bool:
if optname.name in BUILTIN_OPTIONS_PER_MACHINE:

@ -35,6 +35,12 @@ def make_lower_case(val: T.Any) -> T.Union[str, T.List[T.Any]]: # T.Any because
else:
return str(val)
def insert_build_prefix(k: str) -> str:
idx = k.find(':')
if idx < 0:
return 'build.' + k
return k[:idx + 1] + 'build.' + k[idx + 1:]
class ConfException(mesonlib.MesonException):
pass
@ -203,7 +209,7 @@ class Conf:
self.coredata.compiler_options.host.items())))
build_compiler_options = self.split_options_per_subproject(
dict(self.coredata.flatten_lang_iterator(
(self.coredata.insert_build_prefix(k), o)
(insert_build_prefix(k), o)
for k, o in self.coredata.compiler_options.build.items())))
project_options = self.split_options_per_subproject(self.coredata.user_options)
show_build_options = self.default_values_only or self.build.environment.is_cross_build()
@ -212,7 +218,7 @@ class Conf:
self.print_options('Core options', core_options[''])
self.print_options('', self.coredata.builtins_per_machine.host)
if show_build_options:
self.print_options('', {self.coredata.insert_build_prefix(k): o for k, o in self.coredata.builtins_per_machine.build.items()})
self.print_options('', {insert_build_prefix(k): o for k, o in self.coredata.builtins_per_machine.build.items()})
self.print_options('Backend options', self.coredata.backend_options)
self.print_options('Base options', self.coredata.base_options)
self.print_options('Compiler options', host_compiler_options.get('', {}))

Loading…
Cancel
Save