build/meson: cross compile fix distro

In case of cross compilation the target distro is not the same as the
distro of the build machine.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1309
This commit is contained in:
Adrian Freihofer
2022-07-22 12:19:44 +02:00
committed by Thomas Haller
parent 7c04f57320
commit be0daab3e3

View File

@@ -287,7 +287,9 @@ glib_dep = declare_dependency(
]
)
if run_command('test', '-e', '/etc/sysconfig/network-scripts').returncode() == 0
if meson.is_cross_build()
distro = 'unknown'
elif run_command('test', '-e', '/etc/sysconfig/network-scripts').returncode() == 0
distro = 'redhat'
elif run_command('test', '-e', '/etc/SuSE-release').returncode() == 0
distro = 'suse'