Commit b9e4ffa2 authored by Niklas Haas's avatar Niklas Haas

meson: only search for glslang if shaderc unavailable

This skips glslang by default if it's set to 'auto' when shaderc is also
found. (However, we still explicitly search for it if glslang is set to
"disabled", just to make the log clearer)
parent eb29b8af
......@@ -103,23 +103,57 @@ tests = [
'utils.c',
]
# Work-arounds for shaderc braindeath
shaderc_names = [
'shaderc_shared',
'shaderc_combined',
'shaderc',
]
shaderc = disabler()
foreach n : shaderc_names
if not shaderc.found()
shaderc = cc.find_library(n, required: get_option('shaderc'))
endif
endforeach
if shaderc.found()
conf_internal.set('SHADERC_HAS_PERF', cc.has_header_symbol(
'shaderc/shaderc.h',
'shaderc_optimization_level_performance',
dependencies: shaderc,
))
endif
# Work-arounds for glslang braindeath
glslang_combined = disabler()
glslang_min_ver = 2763
glslang_req = get_option('glslang')
glslang_deps = [
cxx.find_library('glslang', required: glslang_req),
cxx.find_library('HLSL', required: glslang_req),
cxx.find_library('OGLCompiler', required: glslang_req),
cxx.find_library('OSDependent', required: glslang_req),
cxx.find_library('SPIRV', required: glslang_req),
cxx.find_library('SPVRemapper', required: glslang_req),
]
glslang_found = true
foreach d : glslang_deps
glslang_found = glslang_found and d.found()
endforeach
if glslang_req.auto() and shaderc.found()
# we only need one or the other, and shaderc is preferred
message('Skipping `glslang` because `shaderc` is available')
glslang_req = false
glslang_found = false
else
glslang_deps = [
cxx.find_library('glslang', required: glslang_req),
cxx.find_library('HLSL', required: glslang_req),
cxx.find_library('OGLCompiler', required: glslang_req),
cxx.find_library('OSDependent', required: glslang_req),
cxx.find_library('SPIRV', required: glslang_req),
cxx.find_library('SPVRemapper', required: glslang_req),
]
glslang_found = true
foreach d : glslang_deps
glslang_found = glslang_found and d.found()
endforeach
endif
if glslang_found
glslang_ver = cxx.get_define('GLSLANG_PATCH_LEVEL',
......@@ -140,28 +174,6 @@ if glslang_found
endif
endif
# Work-arounds for shaderc braindeath
shaderc_names = [
'shaderc_shared',
'shaderc_combined',
'shaderc',
]
shaderc = disabler()
foreach n : shaderc_names
if not shaderc.found()
shaderc = cc.find_library(n, required: get_option('shaderc'))
endif
endforeach
if shaderc.found()
conf_internal.set('SHADERC_HAS_PERF', cc.has_header_symbol(
'shaderc/shaderc.h',
'shaderc_optimization_level_performance',
dependencies: shaderc,
))
endif
# Optional dependencies / components
components = [
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment