add location nodes to some Feature calls

pull/9488/head
Eli Schwartz 3 years ago
parent 8dbb0ee476
commit 32821be623
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 4
      mesonbuild/interpreter/interpreter.py
  2. 4
      mesonbuild/modules/gnome.py
  3. 17
      mesonbuild/modules/qt.py
  4. 8
      mesonbuild/modules/unstable_external_project.py
  5. 6
      mesonbuild/modules/windows.py

@ -1723,7 +1723,7 @@ external dependencies (including libraries) must go to "dependencies".''')
# they could need substitutions (e.g. @BASENAME@) first. CustomTarget()
# will take care of setting a proper default but name must be an empty
# string in the meantime.
FeatureNew('custom_target() with no name argument', '0.60.0').use(self.subproject)
FeatureNew('custom_target() with no name argument', '0.60.0', location=node).use(self.subproject)
name = ''
kwargs['install_mode'] = self._get_kwarg_install_mode(kwargs)
if 'input' in kwargs:
@ -2240,7 +2240,7 @@ This will become a hard error in the future.''', location=self.current_node)
if idir is False:
idir = ''
FeatureDeprecated.single_use('configure_file install_dir: false', '0.50.0',
self.subproject, 'Use the `install:` kwarg instead')
self.subproject, 'Use the `install:` kwarg instead', location=node)
if not isinstance(idir, str):
if isinstance(idir, list) and len(idir) == 0:
mlog.deprecation('install_dir: kwarg must be a string and not an empty array. '

@ -991,7 +991,7 @@ class GnomeModule(ExtensionModule):
if '--warn-error' in scan_command:
FeatureDeprecated.single_use('gnome.generate_gir argument --warn-error', '0.55.0',
state.subproject, 'Use "fatal_warnings" keyword argument')
state.subproject, 'Use "fatal_warnings" keyword argument', state.current_node)
if kwargs['fatal_warnings']:
scan_command.append('--warn-error')
@ -1048,7 +1048,7 @@ class GnomeModule(ExtensionModule):
sources = kwargs['sources']
if args[1]:
FeatureDeprecated.single_use('gnome.yelp more than one positional argument', '0.60.0',
state.subproject, 'use the "sources" keyword argument instead.')
state.subproject, 'use the "sources" keyword argument instead.', state.current_node)
if not sources:
sources = args[1]
if not sources:

@ -293,7 +293,8 @@ class QtBaseModule(ExtensionModule):
Uses CustomTargets to generate .cpp files from .qrc files.
"""
if any(isinstance(s, (build.CustomTarget, build.CustomTargetIndex, build.GeneratedList)) for s in kwargs['sources']):
FeatureNew.single_use('qt.compile_resources: custom_target or generator for "sources" keyword argument', '0.60.0', state.subproject)
FeatureNew.single_use('qt.compile_resources: custom_target or generator for "sources" keyword argument',
'0.60.0', state.subproject, location=state.current_node)
out = self._compile_resources_impl(state, kwargs)
return ModuleReturnValue(out, [out])
@ -372,7 +373,8 @@ class QtBaseModule(ExtensionModule):
def compile_ui(self, state: 'ModuleState', args: T.Tuple, kwargs: 'UICompilerKwArgs') -> ModuleReturnValue:
"""Compile UI resources into cpp headers."""
if any(isinstance(s, (build.CustomTarget, build.CustomTargetIndex, build.GeneratedList)) for s in kwargs['sources']):
FeatureNew.single_use('qt.compile_ui: custom_target or generator for "sources" keyword argument', '0.60.0', state.subproject)
FeatureNew.single_use('qt.compile_ui: custom_target or generator for "sources" keyword argument',
'0.60.0', state.subproject, location=state.current_node)
out = self._compile_ui_impl(state, kwargs)
return ModuleReturnValue(out, [out])
@ -415,9 +417,11 @@ class QtBaseModule(ExtensionModule):
)
def compile_moc(self, state: 'ModuleState', args: T.Tuple, kwargs: 'MocCompilerKwArgs') -> ModuleReturnValue:
if any(isinstance(s, (build.CustomTarget, build.CustomTargetIndex, build.GeneratedList)) for s in kwargs['headers']):
FeatureNew.single_use('qt.compile_moc: custom_target or generator for "headers" keyword argument', '0.60.0', state.subproject)
FeatureNew.single_use('qt.compile_moc: custom_target or generator for "headers" keyword argument',
'0.60.0', state.subproject, location=state.current_node)
if any(isinstance(s, (build.CustomTarget, build.CustomTargetIndex, build.GeneratedList)) for s in kwargs['sources']):
FeatureNew.single_use('qt.compile_moc: custom_target or generator for "sources" keyword argument', '0.60.0', state.subproject)
FeatureNew.single_use('qt.compile_moc: custom_target or generator for "sources" keyword argument',
'0.60.0', state.subproject, location=state.current_node)
out = self._compile_moc_impl(state, kwargs)
return ModuleReturnValue(out, [out])
@ -476,7 +480,7 @@ class QtBaseModule(ExtensionModule):
def preprocess(self, state: 'ModuleState', args: T.List[T.Union[str, File]], kwargs: 'PreprocessKwArgs') -> ModuleReturnValue:
_sources = args[1:]
if _sources:
FeatureDeprecated.single_use('qt.preprocess positional sources', '0.59', state.subproject)
FeatureDeprecated.single_use('qt.preprocess positional sources', '0.59', state.subproject, location=state.current_node)
# List is invariant, os we have to cast...
sources = T.cast(T.List[T.Union[str, File, build.GeneratedList, build.CustomTarget]],
_sources + kwargs['sources'])
@ -527,7 +531,8 @@ class QtBaseModule(ExtensionModule):
def compile_translations(self, state: 'ModuleState', args: T.Tuple, kwargs: 'CompileTranslationsKwArgs') -> ModuleReturnValue:
ts_files = kwargs['ts_files']
if any(isinstance(s, (build.CustomTarget, build.CustomTargetIndex, build.GeneratedList)) for s in ts_files):
FeatureNew.single_use('qt.compile_translations: custom_target or generator for "ts_files" keyword argument', '0.60.0', state.subproject)
FeatureNew.single_use('qt.compile_translations: custom_target or generator for "ts_files" keyword argument',
'0.60.0', state.subproject, location=state.current_node)
install_dir = kwargs['install_dir']
qresource = kwargs['qresource']
if qresource:

@ -101,7 +101,7 @@ class ExternalProject(NewExtensionModule):
def _configure(self, state: 'ModuleState') -> None:
if self.configure_command == 'waf':
FeatureNew('Waf external project', '0.60.0').use(self.subproject)
FeatureNew('Waf external project', '0.60.0', location=state.current_node).use(self.subproject)
waf = state.find_program('waf')
configure_cmd = waf.get_command()
configure_cmd += ['configure', '-o', str(self.build_dir)]
@ -120,7 +120,7 @@ class ExternalProject(NewExtensionModule):
('LIBDIR', '--libdir=@PREFIX@/@LIBDIR@', self.libdir.as_posix()),
('INCLUDEDIR', None, self.includedir.as_posix()),
]
self._validate_configure_options(d)
self._validate_configure_options(d, state)
configure_cmd += self._format_options(self.configure_options, d)
@ -165,7 +165,7 @@ class ExternalProject(NewExtensionModule):
def _quote_and_join(self, array: T.List[str]) -> str:
return ' '.join([shlex.quote(i) for i in array])
def _validate_configure_options(self, variables: T.List[T.Tuple[str, str, str]]) -> None:
def _validate_configure_options(self, variables: T.List[T.Tuple[str, str, str]], state: 'ModuleState') -> None:
# Ensure the user at least try to pass basic info to the build system,
# like the prefix, libdir, etc.
for key, default, val in variables:
@ -176,7 +176,7 @@ class ExternalProject(NewExtensionModule):
if key_format in option:
break
else:
FeatureNew('Default configure_option', '0.57.0').use(self.subproject)
FeatureNew('Default configure_option', '0.57.0', location=state.current_node).use(self.subproject)
self.configure_options.append(default)
def _format_options(self, options: T.List[str], variables: T.List[T.Tuple[str, str, str]]) -> T.List[str]:

@ -150,14 +150,16 @@ class WindowsModule(ExtensionModule):
elif isinstance(src, mesonlib.File):
yield src.relative_name(), src.fname, src
elif isinstance(src, build.CustomTargetIndex):
FeatureNew.single_use('windows.compile_resource CustomTargetIndex in positional arguments', '0.61.0', state.subproject)
FeatureNew.single_use('windows.compile_resource CustomTargetIndex in positional arguments', '0.61.0',
state.subproject, location=state.current_node)
# This dance avoids a case where two indexs of the same
# target are given as separate arguments.
yield (f'{src.get_id()}_{src.target.get_outputs().index(src.output)}',
f'windows_compile_resources_{src.get_filename()}', src)
else:
if len(src.get_outputs()) > 1:
FeatureNew.single_use('windows.compile_resource CustomTarget with multiple outputs in positional arguments', '0.61.0', state.subproject)
FeatureNew.single_use('windows.compile_resource CustomTarget with multiple outputs in positional arguments',
'0.61.0', state.subproject, location=state.current_node)
for i, out in enumerate(src.get_outputs()):
# Chances are that src.get_filename() is already the name of that
# target, add a prefix to avoid name clash.

Loading…
Cancel
Save