meson: Stop using deprecated way getting path of files
authorAndres Freund <[email protected]>
Fri, 1 Dec 2023 01:43:39 +0000 (17:43 -0800)
committerAndres Freund <[email protected]>
Fri, 1 Dec 2023 03:25:40 +0000 (19:25 -0800)
The just released meson 1.3 strongly deprecated a hack we were using, emitting
a noisy warning (the hack basically depended on an implementation detail to
work). Turns out there has been a better way available for a while, I just
hadn't found it. 1.4 added a more convenient approach, but we can't rely on
that.

Reviewed-by: Tristan Partin <[email protected]>
Discussion: https://postgr.es/m/20231129185053[email protected]
Backpatch: 16-, where the meson build was added.

meson.build

index f77d69675807a96c8315d0b2c8f1c6fc9e7c8803..0f2c76ec25ef84fbc5593ff233ea298eb88f778d 100644 (file)
@@ -2924,8 +2924,12 @@ potentially_conflicting_files = []
 foreach t : potentially_conflicting_files_t
   potentially_conflicting_files += t.full_path()
 endforeach
-foreach t : configure_files
-  t = '@0@'.format(t)
+foreach t1 : configure_files
+  if meson.version().version_compare('>=0.59')
+    t = fs.parent(t1) / fs.name(t1)
+  else
+    t = '@0@'.format(t1)
+  endif
   potentially_conflicting_files += meson.current_build_dir() / t
 endforeach
 foreach sub, fnames : generated_sources_ac