meson: Only require libexpat when a part of the build needs it.

Now that xmlconfig can be built without libexpat on Android, we can make
android builds not require the presence of libexpat for many drivers.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7223>
This commit is contained in:
Eric Anholt 2020-10-19 12:28:17 -07:00 committed by Marge Bot
parent 442a769600
commit 81a0f1eca2
2 changed files with 7 additions and 3 deletions

View File

@ -276,6 +276,9 @@ with_freedreno_kgsl = get_option('freedreno-kgsl')
with_broadcom_vk = _vulkan_drivers.contains('broadcom')
with_any_vk = _vulkan_drivers.length() != 0
with_any_broadcom = with_gallium_vc4 or with_gallium_v3d or with_broadcom_vk
with_any_intel = with_dri_i965 or with_intel_vk or with_gallium_iris
if with_swrast_vk and not with_gallium_softpipe
error('swrast vulkan requires gallium swrast')
endif
@ -1365,7 +1368,8 @@ if dep_thread.found() and host_machine.system() != 'windows'
endif
endif
if host_machine.system() != 'windows'
dep_expat = dependency('expat', fallback : ['expat', 'expat_dep'])
dep_expat = dependency('expat', fallback : ['expat', 'expat_dep'],
required: not with_platform_android or with_any_broadcom or with_any_intel)
else
dep_expat = null_dep
endif

View File

@ -73,7 +73,7 @@ endif
if with_gallium_radeonsi or with_amd_vk
subdir('amd')
endif
if with_gallium_vc4 or with_gallium_v3d or with_broadcom_vk
if with_any_broadcom
subdir('broadcom')
endif
if with_gallium_etnaviv
@ -88,7 +88,7 @@ endif
if with_gallium_virgl
subdir('virtio')
endif
if with_dri_i965 or with_intel_vk or with_gallium_iris
if with_any_intel
subdir('intel')
endif
subdir('mesa')