meson: Fix deprecated meson warnings
Fix the warnings related to deprecated meson functions:
WARNING: Project targeting '>= 0.57.0' but tried to use feature deprecated since '0.56.0': Dependency.get_pkgconfig_variable. use Dependency.get_variable(pkgconfig : ...) instead
WARNING: Project targeting '>= 0.57.0' but tried to use feature deprecated since '0.56.0': meson.source_root. use meson.project_source_root() or meson.global_source_root() instead.
Tested: Verify that there are no such warnings in local CI.
Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: I1388aaa12161d020d06657e507ddef78cb116ffe
diff --git a/meson.build b/meson.build
index 1367a72..f6f3f35 100644
--- a/meson.build
+++ b/meson.build
@@ -150,7 +150,7 @@
ssl = dependency('openssl')
systemd = dependency('systemd')
-systemd_system_unit_dir = systemd.get_pkgconfig_variable('systemdsystemunitdir')
+systemd_system_unit_dir = systemd.get_variable(pkgconfig : 'systemdsystemunitdir')
unit_files = [
'obmc-flash-bmc-setenv@.service.in',
diff --git a/usb/meson.build b/usb/meson.build
index b8a138a..bb1dc60 100644
--- a/usb/meson.build
+++ b/usb/meson.build
@@ -40,12 +40,12 @@
install_dir: get_option('bindir')
)
-systemd_system_unit_dir = dependency('systemd').get_pkgconfig_variable(
- 'systemdsystemunitdir',
- define_variable: ['prefix', get_option('prefix')])
-udev_dir = dependency('udev').get_pkgconfig_variable(
- 'udev_dir',
- define_variable: ['prefix', get_option('prefix')])
+systemd_system_unit_dir = dependency('systemd').get_variable(
+ pkgconfig: 'systemdsystemunitdir',
+ pkgconfig_define: ['prefix', get_option('prefix')])
+udev_dir = dependency('udev').get_variable(
+ pkgconfig: 'udev_dir',
+ pkgconfig_define: ['prefix', get_option('prefix')])
install_data(
'services/usb-code-update@.service',
diff --git a/xyz/openbmc_project/Software/Image/meson.build b/xyz/openbmc_project/Software/Image/meson.build
index 4ae382f..0783a60 100644
--- a/xyz/openbmc_project/Software/Image/meson.build
+++ b/xyz/openbmc_project/Software/Image/meson.build
@@ -3,7 +3,7 @@
capture: true,
command: [
sdbusplusplus_prog,
- '-r', meson.source_root(),
+ '-r', meson.project_source_root(),
'error',
'exception-header',
'xyz.openbmc_project.Software.Image',
@@ -19,7 +19,7 @@
capture: true,
command: [
sdbusplusplus_prog,
- '-r', meson.source_root(),
+ '-r', meson.project_source_root(),
'error',
'exception-cpp',
'xyz.openbmc_project.Software.Image',