util: Add xmlconfig build option

On embedded Linux, we can hardcode the driconf file (00-mesa-defaults.conf) with
no possibility of the file changing after the build. The static driconf
implementation, used on Windows and Android, suffices for that use case. It is
undesireable for these platforms to depend on expat or to spend time during app
start-up parsing driconf XML.

We already have the static driconf implemented, all we need is a meson option to
opt-out of runtime xmlconfig on Linux and use the static version instead.

To opt-out of runtime xmlconfig, build Mesa with -Dxmlconfig=disabled.

v2: Expand out feature.require() since it was only added in meson 0.59.0.

v3: Use more concise Meson syntax (Dylan)

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com> [v2]
Reviewed-by: Eric Engestrom <eric@igalia.com> [v2]
Reviewed-by: Emma Anholt <emma@anholt.net>
Tested-by: Chris Healy <healych@amazon.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19626>
This commit is contained in:
Alyssa Rosenzweig
2022-11-09 14:30:31 -05:00
committed by Marge Bot
parent fb0a4a5d6c
commit 662bb5977b
2 changed files with 18 additions and 4 deletions

View File

@@ -555,3 +555,9 @@ option(
value : 8,
description : 'Minimum Windows version to support. Defaults to Windows 8.'
)
option(
'xmlconfig',
type : 'feature',
value : 'auto',
description : 'Build custom xmlconfig (driconf) support. If disabled, the default driconf file is hardcoded into Mesa. Requires expat.'
)