From d3a256959e923b501dc5b277d56850ee66be16a4 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Tue, 24 Dec 2019 08:55:07 +0100 Subject: [PATCH] meson: work around yet more glslang braindeath Simple work-around to https://github.com/KhronosGroup/glslang/issues/1959 is to simply brute force `/usr/include/glslang` into our include path, that way the SPIRV includes will continue working as-is. (We also add a separate line to help with use cases like e.g. VLC where the location of the glslang headers are relative to the build prefix) We do it hackily by directly accessing the compiler flags because these directories may not necessarily exist, and meson doesn't like using `include_directories` with nonexistant paths. --- meson.build | 2 +- src/meson.build | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index b7833ef0..305f6d54 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project('libplacebo', ['c', 'cpp'], license: 'LGPL2.1+', default_options: ['c_std=c99'], - meson_version: '>=0.47', + meson_version: '>=0.49', version: '1.29.0', ) diff --git a/src/meson.build b/src/meson.build index ad22999e..d2f432d2 100644 --- a/src/meson.build +++ b/src/meson.build @@ -92,6 +92,18 @@ if glslang_found pthread = cxx.find_library('pthread', required: false) glslang_all_deps = glslang_deps + glslang_opt_deps + [pthread] glslang_combined = declare_dependency(dependencies: glslang_all_deps) + + # Work around a glslang include path bug w.r.t stuff previously namespaced + # under /usr/include/SPIRV now being moved to /usr/include/glslang/SPIRV. + extra_glslang_inc = [ + '/usr/include/glslang', + get_option('prefix') / get_option('includedir') / 'glslang', + ] + + foreach i : extra_glslang_inc + add_project_arguments('-I' + i, language: 'cpp') + endforeach + else error('glslang revision @0@ too old! Must be at least @1@' .format(glslang_ver, glslang_min_ver))