I’m currently trying to work with the vulkan c++ bindings tutorials using the meson build system. Linking vulkan is easy in meson, using glslang not so much.
Thanks to the answer in this closed topic:
the following works for a trivial call to glslang::InitializeProcess()
and glslang::FinalizeProcess()
when using meson on a machine where glslang is available:
cpp = meson.get_compiler('cpp')
dep_glsl = cpp.find_library('glslang', has_headers : ['glslang/SPIRV/GlslangToSpv.h'])
dep_machine_independent = cpp.find_library('MachineIndependent')
dep_os_dependent = cpp.find_library('OSDependent')
dep_generic_code_gen = cpp.find_library('GenericCodeGen')
dep_ogl_compiler = cpp.find_library('OGLCompiler')
executable(
...
, dependencies: [dep_glsl, dep_machine_independent, dep_os_dependent, dep_generic_code_gen, dep_ogl_compiler]
...
)
Headers from the local glslang installation that follow the same folder structure as the github repo can then be included:
#include "glslang/SPIRV/GlslangToSpv.h"
Thank you very much zeplaz for being a great help.
Hope this snippet is helpful to someone else in the future.