mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-25 06:05:58 +01:00
bb2946f737
Now that the DRM backend no longer depends on GBM, we can make it optional. The GLES2 renderer still depends on it because of our EGL device selection. This is useful for compositors with their own renderers, and for compositors using the Vulkan renderer.
25 lines
703 B
Meson
25 lines
703 B
Meson
allocators = get_option('allocators')
|
|
if 'auto' in allocators and get_option('auto_features').enabled()
|
|
allocators = ['gbm']
|
|
elif 'auto' in renderers and get_option('auto_features').disabled()
|
|
allocators = []
|
|
endif
|
|
|
|
wlr_files += files(
|
|
'allocator.c',
|
|
'shm.c',
|
|
'drm_dumb.c',
|
|
)
|
|
|
|
gbm = disabler()
|
|
if 'gbm' in allocators or 'auto' in allocators
|
|
gbm = dependency('gbm', version: '>=17.1.0', required: 'gbm' in allocators)
|
|
endif
|
|
if gbm.found()
|
|
wlr_files += files('gbm.c')
|
|
wlr_deps += gbm
|
|
features += { 'gbm-allocator': true }
|
|
|
|
has = cc.has_function('gbm_bo_get_fd_for_plane', dependencies: [gbm])
|
|
add_project_arguments('-DHAS_GBM_BO_GET_FD_FOR_PLANE=@0@'.format(has.to_int()), language: 'c')
|
|
endif
|