Skip to content

Commit

Permalink
meson: work around yet more glslang braindeath
Browse files Browse the repository at this point in the history
Simple work-around to KhronosGroup/glslang#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.
  • Loading branch information
haasn committed Dec 24, 2019
1 parent f2178b8 commit d3a2569
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -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',
)

Expand Down
12 changes: 12 additions & 0 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit d3a2569

Please sign in to comment.