meson: Make any Meson-provided dependencies available to cargo

Fixes #512
This commit is contained in:
L. E. Segovia 2024-03-12 18:11:36 -03:00
parent b29a739fb2
commit f1d0667e0b

View file

@ -454,12 +454,18 @@ if pkg_config.found()
extra_env += {'PKG_CONFIG': pkg_config.full_path()}
endif
pkg_config_path = get_option('pkg_config_path')
# Prepend any Meson-provided dependencies (such as the GStreamer
# global project's)
pkg_config_path = [
meson.global_build_root() / 'meson-uninstalled',
meson.project_build_root() / 'meson-uninstalled',
]
if get_option('pkg_config_path').length() > 0
pkg_config_path += [get_option('pkg_config_path')]
endif
if pkg_config_path.length() > 0
pathsep = ':'
if host_system == 'windows'
pathsep = ';'
endif
pathsep = host_system == 'windows' ? ';' : ':'
extra_env += {'PKG_CONFIG_PATH': pathsep.join(pkg_config_path)}
endif