meson: handle dep_libdrm before the driver specific libdrm modules

Handle dep_libdrm before the driver specific libdrm modules, this is for
when libdrm is built as a subproject, for example libdrm_amdgpu is only
available after dep_libdrm has been added.

Acked-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36710>
This commit is contained in:
Antonio Ospite
2025-08-12 18:22:09 +02:00
committed by Marge Bot
parent 9d26eb9a2f
commit ca0f0d7b95

View File

@@ -1691,20 +1691,6 @@ endif
allow_fallback_for_libdrm = get_option('allow-fallback-for').contains('libdrm')
# Then get each libdrm module
foreach d : _libdrm_checks
if d[1]
set_variable(
'dep_libdrm_' + d[0],
dependency(
'libdrm_' + d[0],
version : '>=' + _drm_ver,
allow_fallback: allow_fallback_for_libdrm,
)
)
endif
endforeach
with_gallium_drisw_kms = false
if system_has_kms_drm
dep_libdrm = dependency(
@@ -1724,6 +1710,20 @@ if dep_libdrm.found()
endif
endif
# Then get each libdrm module
foreach d : _libdrm_checks
if d[1]
set_variable(
'dep_libdrm_' + d[0],
dependency(
'libdrm_' + d[0],
version : '>=' + _drm_ver,
allow_fallback: allow_fallback_for_libdrm,
)
)
endif
endforeach
dep_libudev = dependency('libudev', required : false)
if dep_libudev.found()
pre_args += '-DHAVE_LIBUDEV'