mirror of https://gitlab.freedesktop.org/mesa/mesa
meson: Don't depend on expat for !use_xmlconfig
If we don't use xmlconfig, expat becomes an optional dependency on Linux/BSD, which may be convenient for embedded systems that do not otherwise need expat. (expat is so ubiquitous that this probably doesn't matter a ton in practice, but fewer required Mesa deps is probably nice anyway.) Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Suggested-by: Dylan Baker <dylan.c.baker@intel.com> Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19626>
This commit is contained in:
parent
6cd392cbe2
commit
bdc240e13e
16
meson.build
16
meson.build
|
@ -1633,13 +1633,21 @@ if dep_thread.found()
|
||||||
pre_args += '-DHAVE_PTHREAD_SETAFFINITY'
|
pre_args += '-DHAVE_PTHREAD_SETAFFINITY'
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# We don't have expat on Android or Windows, which is a needed dep for xmlconfig
|
||||||
|
supports_xmlconfig = not (with_platform_android or with_platform_windows)
|
||||||
|
|
||||||
|
opt_xmlconfig = get_option('xmlconfig')
|
||||||
|
if opt_xmlconfig.enabled() and not supports_xmlconfig
|
||||||
|
error('xmlconfig not available on Android or Windows')
|
||||||
|
endif
|
||||||
|
use_xmlconfig = supports_xmlconfig and not opt_xmlconfig.disabled()
|
||||||
|
|
||||||
if host_machine.system() == 'darwin'
|
if host_machine.system() == 'darwin'
|
||||||
dep_expat = meson.get_compiler('c').find_library('expat')
|
dep_expat = meson.get_compiler('c').find_library('expat')
|
||||||
elif host_machine.system() != 'windows'
|
|
||||||
dep_expat = dependency('expat', fallback : ['expat', 'expat_dep'],
|
|
||||||
required: not with_platform_android)
|
|
||||||
else
|
else
|
||||||
dep_expat = null_dep
|
dep_expat = dependency('expat', fallback : ['expat', 'expat_dep'],
|
||||||
|
required: use_xmlconfig)
|
||||||
endif
|
endif
|
||||||
# Predefined macros for windows
|
# Predefined macros for windows
|
||||||
if host_machine.system() == 'windows'
|
if host_machine.system() == 'windows'
|
||||||
|
|
|
@ -284,15 +284,6 @@ idep_mesautil = declare_dependency(
|
||||||
dependencies : deps_for_libmesa_util,
|
dependencies : deps_for_libmesa_util,
|
||||||
)
|
)
|
||||||
|
|
||||||
# We don't have expat on Android or Windows, which is a needed dep for xmlconfig
|
|
||||||
supports_xmlconfig = not (with_platform_android or with_platform_windows)
|
|
||||||
|
|
||||||
opt_xmlconfig = get_option('xmlconfig')
|
|
||||||
if opt_xmlconfig.enabled() and not supports_xmlconfig
|
|
||||||
error('xmlconfig not available on Android or Windows')
|
|
||||||
endif
|
|
||||||
use_xmlconfig = supports_xmlconfig and not opt_xmlconfig.disabled()
|
|
||||||
|
|
||||||
# Only install the drirc file if we build with support for parsing drirc files
|
# Only install the drirc file if we build with support for parsing drirc files
|
||||||
if use_xmlconfig
|
if use_xmlconfig
|
||||||
install_data(files_drirc, install_dir : join_paths(get_option('datadir'), 'drirc.d'))
|
install_data(files_drirc, install_dir : join_paths(get_option('datadir'), 'drirc.d'))
|
||||||
|
|
Loading…
Reference in New Issue