Skip to content

Commit

Permalink
coredata: delete a bunch of unused methods
Browse files Browse the repository at this point in the history
Added by the optionrefactor changes, but not used
  • Loading branch information
dcbaker committed Mar 4, 2025
1 parent 2073cf3 commit 91baedd
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 55 deletions.
49 changes: 0 additions & 49 deletions mesonbuild/coredata.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ def __init__(self, cmd_options: SharedCMDOptions, scratch_dir: str, meson_comman
self.meson_command = meson_command
self.target_guids = {}
self.version = version
self.sp_option_overrides: T.Dict[str, str] = {}
self.cross_files = self.__load_config_files(cmd_options, scratch_dir, 'cross')
self.compilers: PerMachine[T.Dict[str, Compiler]] = PerMachine(OrderedDict(), OrderedDict())
self.optstore = options.OptionStore(self.is_cross_build())
Expand Down Expand Up @@ -608,54 +607,6 @@ def set_options(self, opts_to_set: T.Dict[OptionKey, T.Any], subproject: str = '

return dirty

def can_set_per_sb(self, keystr):
return True

def set_options_from_configure_strings(self, D_args) -> bool:
dirty = False
for entry in D_args:
if '=' not in entry:
raise MesonException(f'A -D argument must be of form "name=value" instead of {entry}')
key, val = entry.split('=', 1)
if key in self.sp_option_overrides:
self.sp_option_overrides[key] = val
dirty = True
else:
dirty |= self.set_options({OptionKey(key): val})
return dirty

def create_sp_options(self, A_args) -> bool:
if A_args is None:
return False
dirty = False
for entry in A_args:
keystr, valstr = entry.split('=', 1)
if ':' not in keystr:
raise MesonException(f'Option to add override has no subproject: {entry}')
if not self.can_set_per_sb(keystr):
raise MesonException(f'Option {keystr} can not be set per subproject.')
if keystr in self.sp_option_overrides:
raise MesonException(f'Override {keystr} already exists.')
key = self.optstore.split_keystring(keystr)
original_key = key.copy_with(subproject=None)
if not self.optstore.has_option(original_key):
raise MesonException('Tried to override a nonexisting key.')
self.sp_option_overrides[keystr] = valstr
dirty = True
return dirty

def remove_sp_options(self, U_args) -> bool:
dirty = False
if U_args is None:
return False
for entry in U_args:
if entry in self.sp_option_overrides:
del self.sp_option_overrides[entry]
dirty = True
else:
pass # Deleting a non-existing key ok, I guess?
return dirty

def set_default_options(self, default_options: T.MutableMapping[OptionKey, str], subproject: str, env: 'Environment') -> None:
from .compilers import BASE_OPTIONS

Expand Down
6 changes: 0 additions & 6 deletions mesonbuild/mconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,12 +337,6 @@ def print_nondefault_buildtype_options(self) -> None:
for m in mismatching:
mlog.log(f'{m[0]:21}{m[1]:10}{m[2]:10}')

def print_sp_overrides(self) -> None:
if self.coredata.sp_option_overrides:
mlog.log('\nThe folowing options have per-subproject overrides:')
for k, v in self.coredata.sp_option_overrides.items():
mlog.log(f'{k:21}{v:10}')

def print_augments(self) -> None:
if self.coredata.optstore.augments:
mlog.log('\nCurrently set option augments:')
Expand Down

0 comments on commit 91baedd

Please sign in to comment.