meson: Don't interpolate the result of configure_file() into a format()

configure_file() returns a file object, which was not intended to be a
valid parameter for format() (even though in practice it works the way
we wanted it to), causing newer Meson versions to report deprecation
warnings.

If the version of Meson is new enough, we can use the full_path()
method. Otherwise, we'll have to re-compute the output filename.

Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 872ce4d29a)
This commit is contained in:
Simon McVittie 2024-12-13 10:53:23 +00:00
parent 7094a4047e
commit 25e370ce8f

View file

@ -184,7 +184,12 @@ if cc.has_link_argument(
meson.current_source_dir() / 'test-version-script'
)
)
version_flags = ['-Wl,--version-script,@0@'.format(version_script)]
if meson.version().version_compare('>=1.4.0')
version_script_path = version_script.full_path()
else
version_script_path = meson.current_build_dir() / 'version_script'
endif
version_flags = ['-Wl,--version-script,@0@'.format(version_script_path)]
else
version_flags = []
endif