]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
meson: Don't interpolate the result of configure_file() into a format()
authorSimon McVittie <smcv@collabora.com>
Fri, 13 Dec 2024 10:53:23 +0000 (10:53 +0000)
committerSimon McVittie <smcv@collabora.com>
Fri, 13 Dec 2024 13:58:01 +0000 (13:58 +0000)
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>
dbus/meson.build

index 87f18d914b75fd9fd6e6b715a92c8f92b43dbf98..d2acd059441fded14106a292255d2ab91d8a8a5f 100644 (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