build: resolve deprecated 'copy' key argument in configure_file warning

Resolves the following warning:

NOTICE: Future-deprecated features used:
 * 0.64.0: {'copy arg in configure_file'}

copy arg was deprecated in meson version 0.64. Hence, use
fs.copyfile() that is also introduced in 0.64, in versions
since 0.64 and use the old approach for older versions.
This commit is contained in:
Yegor Yefremov
2024-01-15 09:40:40 +00:00
committed by Aleksander Morgado
parent 19b3e59151
commit 7c23c3db2f
2 changed files with 20 additions and 6 deletions
+15 -6
View File
@@ -11,12 +11,21 @@ service_conf = {
}
# DBus Service file
configure_file(
input: 'org.freedesktop.ModemManager1.conf.@0@polkit'.format(enable_polkit ? '' : 'no'),
output: '@BASENAME@',
copy: true,
install_dir: dbus_policy_dir,
)
if meson_version.version_compare('>=0.64')
fs.copyfile(
'org.freedesktop.ModemManager1.conf.@0@polkit'.format(enable_polkit ? '' : 'no'),
'@BASENAME@',
install: true,
install_dir: dbus_policy_dir,
)
else
configure_file(
input: 'org.freedesktop.ModemManager1.conf.@0@polkit'.format(enable_polkit ? '' : 'no'),
output: '@BASENAME@',
copy: true,
install_dir: dbus_policy_dir,
)
endif
# DBus Activation file
configure_file(
+5
View File
@@ -13,6 +13,11 @@ project(
meson_version: '>= 0.53.0',
)
meson_version = meson.version()
if meson_version.version_compare('>=0.64')
fs = import('fs')
endif
mm_name = meson.project_name()
mm_version = meson.project_version()
version_array = mm_version.split('.')