meson: use a feature option for llvm

Still not as awesome as it should be, but an improvement over what we had
before.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
This commit is contained in:
Dylan Baker 2022-12-20 15:36:13 -08:00 committed by Marge Bot
parent c40e1bb1d0
commit d00c6e0fd7
2 changed files with 3 additions and 12 deletions

View File

@ -1681,17 +1681,10 @@ else
_shared_llvm = (_shared_llvm == 'enabled')
endif
_llvm = get_option('llvm')
if _llvm == 'true'
_llvm = 'enabled'
warning('llvm option "true" deprecated, please use "enabled" instead.')
elif _llvm == 'false'
_llvm = 'disabled'
warning('llvm option "false" deprecated, please use "disabled" instead.')
endif
dep_llvm = null_dep
with_llvm = false
if _llvm != 'disabled'
if _llvm.allowed()
dep_llvm = dependency(
'llvm',
version : _llvm_version,
@ -1699,7 +1692,7 @@ if _llvm != 'disabled'
optional_modules : llvm_optional_modules,
required : (
with_amd_vk or with_gallium_radeonsi or with_gallium_opencl or with_clc
or _llvm == 'enabled'
or _llvm.enabled()
),
static : not _shared_llvm,
fallback : ['llvm', 'dep_llvm'],

View File

@ -317,9 +317,7 @@ option(
)
option(
'llvm',
type : 'combo',
value : 'auto',
choices : ['auto', 'true', 'false', 'enabled', 'disabled'],
type : 'feature',
description : 'Build with LLVM support.'
)
option(