meson: Make shader-cache a trillean instead of boolean
So that it can be implicitly disabled on windows, where it doesn't compile. v2: - Use an auto-option rather than automagic. - fix shader_cache check (== -> !=) v4: - Use new with_shader_cache instead of get_option('shader-cache') elsewhere in the meson build Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
18
meson.build
18
meson.build
@@ -775,9 +775,19 @@ if get_option('buildtype') == 'debug'
|
|||||||
pre_args += '-DDEBUG'
|
pre_args += '-DDEBUG'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if get_option('shader-cache')
|
with_shader_cache = false
|
||||||
pre_args += '-DENABLE_SHADER_CACHE'
|
_shader_cache = get_option('shader-cache')
|
||||||
elif with_amd_vk
|
if _shader_cache != 'false'
|
||||||
|
if host_machine.system() == 'windows'
|
||||||
|
if _shader_cache == 'true'
|
||||||
|
error('Shader Cache does not currently work on Windows')
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
pre_args += '-DENABLE_SHADER_CACHE'
|
||||||
|
with_shader_cache = true
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
if with_amd_vk and not with_shader_cache
|
||||||
error('Radv requires shader cache support')
|
error('Radv requires shader cache support')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -1108,7 +1118,7 @@ if cc.has_function('dl_iterate_phdr')
|
|||||||
pre_args += '-DHAVE_DL_ITERATE_PHDR'
|
pre_args += '-DHAVE_DL_ITERATE_PHDR'
|
||||||
elif with_intel_vk
|
elif with_intel_vk
|
||||||
error('Intel "Anvil" Vulkan driver requires the dl_iterate_phdr function')
|
error('Intel "Anvil" Vulkan driver requires the dl_iterate_phdr function')
|
||||||
elif with_dri_i965 and get_option('shader-cache')
|
elif with_dri_i965 and with_shader_cache
|
||||||
error('Intel i965 GL driver requires dl_iterate_phdr when built with shader caching.')
|
error('Intel i965 GL driver requires dl_iterate_phdr when built with shader caching.')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@@ -157,8 +157,9 @@ option(
|
|||||||
)
|
)
|
||||||
option(
|
option(
|
||||||
'shader-cache',
|
'shader-cache',
|
||||||
type : 'boolean',
|
type : 'combo',
|
||||||
value : true,
|
value : 'auto',
|
||||||
|
choices : ['auto', 'true', 'false'],
|
||||||
description : 'Build with on-disk shader cache support'
|
description : 'Build with on-disk shader cache support'
|
||||||
)
|
)
|
||||||
option(
|
option(
|
||||||
|
Reference in New Issue
Block a user