add location nodes to some Feature calls
This commit is contained in:
parent
8dbb0ee476
commit
32821be623
|
@ -1723,7 +1723,7 @@ external dependencies (including libraries) must go to "dependencies".''')
|
||||||
# they could need substitutions (e.g. @BASENAME@) first. CustomTarget()
|
# they could need substitutions (e.g. @BASENAME@) first. CustomTarget()
|
||||||
# will take care of setting a proper default but name must be an empty
|
# will take care of setting a proper default but name must be an empty
|
||||||
# string in the meantime.
|
# 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 = ''
|
name = ''
|
||||||
kwargs['install_mode'] = self._get_kwarg_install_mode(kwargs)
|
kwargs['install_mode'] = self._get_kwarg_install_mode(kwargs)
|
||||||
if 'input' in 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:
|
if idir is False:
|
||||||
idir = ''
|
idir = ''
|
||||||
FeatureDeprecated.single_use('configure_file install_dir: false', '0.50.0',
|
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 not isinstance(idir, str):
|
||||||
if isinstance(idir, list) and len(idir) == 0:
|
if isinstance(idir, list) and len(idir) == 0:
|
||||||
mlog.deprecation('install_dir: kwarg must be a string and not an empty array. '
|
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:
|
if '--warn-error' in scan_command:
|
||||||
FeatureDeprecated.single_use('gnome.generate_gir argument --warn-error', '0.55.0',
|
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']:
|
if kwargs['fatal_warnings']:
|
||||||
scan_command.append('--warn-error')
|
scan_command.append('--warn-error')
|
||||||
|
|
||||||
|
@ -1048,7 +1048,7 @@ class GnomeModule(ExtensionModule):
|
||||||
sources = kwargs['sources']
|
sources = kwargs['sources']
|
||||||
if args[1]:
|
if args[1]:
|
||||||
FeatureDeprecated.single_use('gnome.yelp more than one positional argument', '0.60.0',
|
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:
|
if not sources:
|
||||||
sources = args[1]
|
sources = args[1]
|
||||||
if not sources:
|
if not sources:
|
||||||
|
|
|
@ -293,7 +293,8 @@ class QtBaseModule(ExtensionModule):
|
||||||
Uses CustomTargets to generate .cpp files from .qrc files.
|
Uses CustomTargets to generate .cpp files from .qrc files.
|
||||||
"""
|
"""
|
||||||
if any(isinstance(s, (build.CustomTarget, build.CustomTargetIndex, build.GeneratedList)) for s in kwargs['sources']):
|
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)
|
out = self._compile_resources_impl(state, kwargs)
|
||||||
return ModuleReturnValue(out, [out])
|
return ModuleReturnValue(out, [out])
|
||||||
|
|
||||||
|
@ -372,7 +373,8 @@ class QtBaseModule(ExtensionModule):
|
||||||
def compile_ui(self, state: 'ModuleState', args: T.Tuple, kwargs: 'UICompilerKwArgs') -> ModuleReturnValue:
|
def compile_ui(self, state: 'ModuleState', args: T.Tuple, kwargs: 'UICompilerKwArgs') -> ModuleReturnValue:
|
||||||
"""Compile UI resources into cpp headers."""
|
"""Compile UI resources into cpp headers."""
|
||||||
if any(isinstance(s, (build.CustomTarget, build.CustomTargetIndex, build.GeneratedList)) for s in kwargs['sources']):
|
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)
|
out = self._compile_ui_impl(state, kwargs)
|
||||||
return ModuleReturnValue(out, [out])
|
return ModuleReturnValue(out, [out])
|
||||||
|
|
||||||
|
@ -415,9 +417,11 @@ class QtBaseModule(ExtensionModule):
|
||||||
)
|
)
|
||||||
def compile_moc(self, state: 'ModuleState', args: T.Tuple, kwargs: 'MocCompilerKwArgs') -> ModuleReturnValue:
|
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']):
|
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']):
|
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)
|
out = self._compile_moc_impl(state, kwargs)
|
||||||
return ModuleReturnValue(out, [out])
|
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:
|
def preprocess(self, state: 'ModuleState', args: T.List[T.Union[str, File]], kwargs: 'PreprocessKwArgs') -> ModuleReturnValue:
|
||||||
_sources = args[1:]
|
_sources = args[1:]
|
||||||
if _sources:
|
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...
|
# List is invariant, os we have to cast...
|
||||||
sources = T.cast(T.List[T.Union[str, File, build.GeneratedList, build.CustomTarget]],
|
sources = T.cast(T.List[T.Union[str, File, build.GeneratedList, build.CustomTarget]],
|
||||||
_sources + kwargs['sources'])
|
_sources + kwargs['sources'])
|
||||||
|
@ -527,7 +531,8 @@ class QtBaseModule(ExtensionModule):
|
||||||
def compile_translations(self, state: 'ModuleState', args: T.Tuple, kwargs: 'CompileTranslationsKwArgs') -> ModuleReturnValue:
|
def compile_translations(self, state: 'ModuleState', args: T.Tuple, kwargs: 'CompileTranslationsKwArgs') -> ModuleReturnValue:
|
||||||
ts_files = kwargs['ts_files']
|
ts_files = kwargs['ts_files']
|
||||||
if any(isinstance(s, (build.CustomTarget, build.CustomTargetIndex, build.GeneratedList)) for s in 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']
|
install_dir = kwargs['install_dir']
|
||||||
qresource = kwargs['qresource']
|
qresource = kwargs['qresource']
|
||||||
if qresource:
|
if qresource:
|
||||||
|
|
|
@ -101,7 +101,7 @@ class ExternalProject(NewExtensionModule):
|
||||||
|
|
||||||
def _configure(self, state: 'ModuleState') -> None:
|
def _configure(self, state: 'ModuleState') -> None:
|
||||||
if self.configure_command == 'waf':
|
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')
|
waf = state.find_program('waf')
|
||||||
configure_cmd = waf.get_command()
|
configure_cmd = waf.get_command()
|
||||||
configure_cmd += ['configure', '-o', str(self.build_dir)]
|
configure_cmd += ['configure', '-o', str(self.build_dir)]
|
||||||
|
@ -120,7 +120,7 @@ class ExternalProject(NewExtensionModule):
|
||||||
('LIBDIR', '--libdir=@PREFIX@/@LIBDIR@', self.libdir.as_posix()),
|
('LIBDIR', '--libdir=@PREFIX@/@LIBDIR@', self.libdir.as_posix()),
|
||||||
('INCLUDEDIR', None, self.includedir.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)
|
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:
|
def _quote_and_join(self, array: T.List[str]) -> str:
|
||||||
return ' '.join([shlex.quote(i) for i in array])
|
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,
|
# Ensure the user at least try to pass basic info to the build system,
|
||||||
# like the prefix, libdir, etc.
|
# like the prefix, libdir, etc.
|
||||||
for key, default, val in variables:
|
for key, default, val in variables:
|
||||||
|
@ -176,7 +176,7 @@ class ExternalProject(NewExtensionModule):
|
||||||
if key_format in option:
|
if key_format in option:
|
||||||
break
|
break
|
||||||
else:
|
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)
|
self.configure_options.append(default)
|
||||||
|
|
||||||
def _format_options(self, options: T.List[str], variables: T.List[T.Tuple[str, str, str]]) -> T.List[str]:
|
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):
|
elif isinstance(src, mesonlib.File):
|
||||||
yield src.relative_name(), src.fname, src
|
yield src.relative_name(), src.fname, src
|
||||||
elif isinstance(src, build.CustomTargetIndex):
|
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
|
# This dance avoids a case where two indexs of the same
|
||||||
# target are given as separate arguments.
|
# target are given as separate arguments.
|
||||||
yield (f'{src.get_id()}_{src.target.get_outputs().index(src.output)}',
|
yield (f'{src.get_id()}_{src.target.get_outputs().index(src.output)}',
|
||||||
f'windows_compile_resources_{src.get_filename()}', src)
|
f'windows_compile_resources_{src.get_filename()}', src)
|
||||||
else:
|
else:
|
||||||
if len(src.get_outputs()) > 1:
|
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()):
|
for i, out in enumerate(src.get_outputs()):
|
||||||
# Chances are that src.get_filename() is already the name of that
|
# Chances are that src.get_filename() is already the name of that
|
||||||
# target, add a prefix to avoid name clash.
|
# target, add a prefix to avoid name clash.
|
||||||
|
|
Loading…
Reference in New Issue