From 56b0e3a575b69f0f835fcf6a307e57dcd29bd5cf Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Sun, 31 Jul 2022 03:08:27 +0800 Subject: [PATCH] meson: Place all pre_args about HAVE_DRI* into single place Signed-off-by: Yonggang Luo Reviewed-by: Eric Engestrom Reviewed-by: Adam Jackson Part-of: --- meson.build | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/meson.build b/meson.build index 1d281da..536d13c 100644 --- a/meson.build +++ b/meson.build @@ -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 -- 2.7.4