diff --git a/meson.build b/meson.build index 75e90e1ff6a..87ce5f7872e 100644 --- a/meson.build +++ b/meson.build @@ -775,9 +775,19 @@ if get_option('buildtype') == 'debug' pre_args += '-DDEBUG' endif -if get_option('shader-cache') - pre_args += '-DENABLE_SHADER_CACHE' -elif with_amd_vk +with_shader_cache = false +_shader_cache = get_option('shader-cache') +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') endif @@ -1108,7 +1118,7 @@ if cc.has_function('dl_iterate_phdr') pre_args += '-DHAVE_DL_ITERATE_PHDR' elif with_intel_vk 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.') endif diff --git a/meson_options.txt b/meson_options.txt index 6cddf33a5c3..1f72faabee8 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -157,8 +157,9 @@ option( ) option( 'shader-cache', - type : 'boolean', - value : true, + type : 'combo', + value : 'auto', + choices : ['auto', 'true', 'false'], description : 'Build with on-disk shader cache support' ) option(