diff --git a/meson.build b/meson.build index 0a227880e4f..277a7842c46 100644 --- a/meson.build +++ b/meson.build @@ -1670,12 +1670,18 @@ if _drm_blame != '' message('libdrm @0@ needed because @1@ has the highest requirement'.format(_drm_ver, _drm_blame)) 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) + dependency( + 'libdrm_' + d[0], + version : '>=' + _drm_ver, + allow_fallback: allow_fallback_for_libdrm, + ) ) endif endforeach @@ -1684,7 +1690,8 @@ with_gallium_drisw_kms = false if system_has_kms_drm dep_libdrm = dependency( 'libdrm', version : '>=' + _drm_ver, - required : with_dri2 or with_dri or with_gbm + required : with_dri2 or with_dri or with_gbm, + allow_fallback: allow_fallback_for_libdrm, ) else # We should prevent libdrm from being available when the target doesn't have it to avoid transitive diff --git a/meson.options b/meson.options index ded6649d511..5fd5102d3fb 100644 --- a/meson.options +++ b/meson.options @@ -832,3 +832,13 @@ option( value : false, description : 'Install the drivers internal shader compilers (if needed for cross builds).' ) + +option( + 'allow-fallback-for', + type : 'array', + value : [], + choices : [ + 'libdrm', + ], + description : 'Allows the fallback mechanism if the dependency is not available on the system, or too old.' +) diff --git a/subprojects/libdrm.wrap b/subprojects/libdrm.wrap new file mode 100644 index 00000000000..9fbfeadfc9e --- /dev/null +++ b/subprojects/libdrm.wrap @@ -0,0 +1,6 @@ +[wrap-file] +directory = libdrm-2.4.123 +source_url = https://dri.freedesktop.org/libdrm/libdrm-2.4.123.tar.xz +source_filename = libdrm-2.4.123.tar.xz +source_hash = a2b98567a149a74b0f50e91e825f9c0315d86e7be9b74394dae8b298caadb79e +wrapdb_version = 2.4.123-1