meson: Place all pre_args about HAVE_DRI* into single place

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17821>
This commit is contained in:
Yonggang Luo 2022-07-31 03:08:27 +08:00 committed by Marge Bot
parent 9d6204c799
commit 56b0e3a575

View file

@ -1686,16 +1686,6 @@ if dep_libdrm.found()
endif
endif
if with_dri
pre_args += '-DHAVE_DRI'
endif
if with_dri2
pre_args += '-DHAVE_DRI2'
endif
if with_gallium_drisw_kms
pre_args += '-DHAVE_DRISW_KMS'
endif
dep_libudev = dependency('libudev', required : false)
if dep_libudev.found()
pre_args += '-DHAVE_LIBUDEV'
@ -2087,6 +2077,7 @@ if host_machine.cpu_family() == 'x86_64' and cc.get_id() == 'gcc'
endif
endif
with_dri3_modifiers = false
if with_platform_x11
if with_glx == 'xlib' or with_glx == 'gallium-xlib'
dep_x11 = dependency('x11')
@ -2112,13 +2103,12 @@ if with_platform_x11
dep_xcb_dri2 = dependency('xcb-dri2', version : '>= 1.8')
if with_dri3
pre_args += '-DHAVE_DRI3'
dep_xcb_dri3 = dependency('xcb-dri3')
dep_xcb_present = dependency('xcb-present')
# until xcb-dri3 has been around long enough to make a hard-dependency:
if (dep_xcb_dri3.version().version_compare('>= 1.13') and
dep_xcb_present.version().version_compare('>= 1.13'))
pre_args += '-DHAVE_DRI3_MODIFIERS'
with_dri3_modifiers = true
endif
dep_xcb_shm = dependency('xcb-shm')
dep_xcb_sync = dependency('xcb-sync')
@ -2150,6 +2140,22 @@ if with_platform_x11
endif
endif
if with_dri
pre_args += '-DHAVE_DRI'
endif
if with_dri2
pre_args += '-DHAVE_DRI2'
endif
if with_dri3
pre_args += '-DHAVE_DRI3'
endif
if with_dri3_modifiers
pre_args += '-DHAVE_DRI3_MODIFIERS'
endif
if with_gallium_drisw_kms
pre_args += '-DHAVE_DRISW_KMS'
endif
if get_option('gallium-extra-hud')
pre_args += '-DHAVE_GALLIUM_EXTRA_HUD=1'
endif