aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2021-11-14 21:15:30 -0500
committerEli Schwartz <eschwartz@archlinux.org>2021-11-20 20:48:30 -0500
commit32821be623d4cc0ea0136b8e0918f50647d6b50b (patch)
tree250e02166420dcea919ba5f18b6f13bae1f67bef /mesonbuild/modules
parent8dbb0ee476493d3059a5b4a4db61fbc3bd162bef (diff)
downloadmeson-32821be623d4cc0ea0136b8e0918f50647d6b50b.zip
meson-32821be623d4cc0ea0136b8e0918f50647d6b50b.tar.gz
meson-32821be623d4cc0ea0136b8e0918f50647d6b50b.tar.bz2
add location nodes to some Feature calls
Diffstat (limited to 'mesonbuild/modules')
-rw-r--r--mesonbuild/modules/gnome.py4
-rw-r--r--mesonbuild/modules/qt.py17
-rw-r--r--mesonbuild/modules/unstable_external_project.py8
-rw-r--r--mesonbuild/modules/windows.py6
4 files changed, 21 insertions, 14 deletions
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index 7876fd6..5798397 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -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:
diff --git a/mesonbuild/modules/qt.py b/mesonbuild/modules/qt.py
index e548a0d..f874c58 100644
--- a/mesonbuild/modules/qt.py
+++ b/mesonbuild/modules/qt.py
@@ -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:
diff --git a/mesonbuild/modules/unstable_external_project.py b/mesonbuild/modules/unstable_external_project.py
index 021c189..c43fc12 100644
--- a/mesonbuild/modules/unstable_external_project.py
+++ b/mesonbuild/modules/unstable_external_project.py
@@ -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]:
diff --git a/mesonbuild/modules/windows.py b/mesonbuild/modules/windows.py
index 4aa7e3a..8285b18 100644
--- a/mesonbuild/modules/windows.py
+++ b/mesonbuild/modules/windows.py
@@ -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.