guard a complicated mlog.warning inside a Feature check

This is only relevant on certain versions of meson, so do not print it
when meson_version is too low.

The message itself is not precisely a deprecation warning, since
ostensibly it may be an unlikely coding mistake. It is probably an
attempt to implement `copy: true`, but it might not be, hence "warning"
instead of "deprecation". So although we could switch this to a
FeatureDeprecated, that is not being done at this time.
pull/9488/head
Eli Schwartz 3 years ago
parent dbb109703e
commit 329783d80c
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 10
      mesonbuild/interpreter/interpreter.py
  2. 2
      test cases/common/14 configure file/meson.build

@ -2184,10 +2184,12 @@ This will become a hard error in the future.''', location=self.current_node)
"present in the given configuration data.", location=node)
if confdata_useless:
ifbase = os.path.basename(inputs_abs[0])
mlog.warning('Got an empty configuration_data() object and found no '
f'substitutions in the input file {ifbase!r}. If you want to '
'copy a file to the build dir, use the \'copy:\' keyword '
'argument added in 0.47.0', location=node)
tv = FeatureNew.get_target_version(self.subproject)
if FeatureNew.check_version(tv, '0.47.0'):
mlog.warning('Got an empty configuration_data() object and found no '
f'substitutions in the input file {ifbase!r}. If you want to '
'copy a file to the build dir, use the \'copy:\' keyword '
'argument added in 0.47.0', location=node)
else:
mesonlib.dump_conf_header(ofile_abs, conf.conf_data, output_format)
conf.mark_used()

@ -1,4 +1,4 @@
project('configure file test', 'c')
project('configure file test', 'c', meson_version: '>=0.47.0')
conf = configuration_data()

Loading…
Cancel
Save