GTK+: slang: Make support autodetect by default.

This commit is contained in:
Brandon Wright 2019-01-25 14:13:05 -06:00
parent febae438c6
commit eefb06a8d4
1 changed files with 26 additions and 21 deletions

View File

@ -80,13 +80,14 @@ endif
slang = get_option('slang')
if slang and opengl
glslang_dep = c_compiler.find_library('glslang')
spirv_dep = c_compiler.find_library('SPIRV')
osdependent_dep = c_compiler.find_library('OSDependent')
hlsl_dep = c_compiler.find_library('HLSL')
ogl_compiler_dep = c_compiler.find_library('OGLCompiler')
spv_remapper_dep = c_compiler.find_library('SPVRemapper')
deps += [glslang_dep, spirv_dep, osdependent_dep, hlsl_dep, ogl_compiler_dep, spv_remapper_dep]
glslang_dep = c_compiler.find_library('glslang', required: false)
spirv_dep = c_compiler.find_library('SPIRV', required: false)
osdependent_dep = c_compiler.find_library('OSDependent', required: false)
ogl_compiler_dep = c_compiler.find_library('OGLCompiler', required: false)
spv_remapper_dep = c_compiler.find_library('SPVRemapper', required: false)
if glslang_dep.found() and spirv_dep.found() and osdependent_dep.found() and ogl_compiler_dep.found() and spv_remapper_dep.found()
deps += [glslang_dep, spirv_dep, osdependent_dep, ogl_compiler_dep, spv_remapper_dep]
args += ['-DUSE_SLANG', '-DSPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS']
srcs += ['../shaders/slang.cpp']
@ -102,6 +103,10 @@ if slang and opengl
'../shaders/SPIRV-Cross/spirv_parser.cpp',
'../shaders/SPIRV-Cross/spirv_parser.hpp',
'../shaders/SPIRV-Cross/spirv.hpp']
else
slang = false
warns += 'glslang libraries not found. Slang shaders will be disabled.'
endif
endif
wayland = get_option('wayland')