1 diff --git a/meson.build b/meson.build
2 index 172c64a7c70..05961e56926 100644
5 @@ -1900,7 +1900,7 @@ endif
9 - llvm_libdir = dep_llvm.get_variable(cmake : 'LLVM_LIBRARY_DIR', configtool: 'libdir')
10 + llvm_libdir = get_option('clang-libdir')
12 dep_clang = cpp.find_library('clang-cpp', dirs : llvm_libdir, required : false)
14 diff --git a/meson_options.txt b/meson_options.txt
15 index 6f307018815..ab84eb1006c 100644
16 --- a/meson_options.txt
17 +++ b/meson_options.txt
19 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26 + description : 'Locations to search for clang libraries.'
31 diff --git a/src/gallium/targets/opencl/meson.build b/src/gallium/targets/opencl/meson.build
32 index db3586bd7fb..4d914206d21 100644
33 --- a/src/gallium/targets/opencl/meson.build
34 +++ b/src/gallium/targets/opencl/meson.build
35 @@ -39,7 +39,8 @@ if dep_llvm.version().version_compare('>=10.0.0')
36 polly_isl_dep = cpp.find_library('PollyISL', dirs : llvm_libdir, required : false)
39 -dep_clang = cpp.find_library('clang-cpp', dirs : llvm_libdir, required : false)
40 +clang_libdir = get_option('clang-libdir')
41 +dep_clang = cpp.find_library('clang-cpp', dirs : clang_libdir, required : false)
43 # meson will return clang-cpp from system dirs if it's not found in llvm_libdir
44 linker_rpath_arg = '-Wl,--rpath=@0@'.format(llvm_libdir)
45 @@ -123,7 +124,7 @@ if with_opencl_icd
46 configuration : _config,
47 input : 'mesa.icd.in',
51 install_dir : join_paths(get_option('sysconfdir'), 'OpenCL', 'vendors'),
54 diff --git a/src/gallium/targets/rusticl/meson.build b/src/gallium/targets/rusticl/meson.build
55 index a968dee52db..69475cf3133 100644
56 --- a/src/gallium/targets/rusticl/meson.build
57 +++ b/src/gallium/targets/rusticl/meson.build
58 @@ -58,7 +58,7 @@ configure_file(
59 configuration : _config,
60 input : 'rusticl.icd.in',
61 output : 'rusticl.icd',
64 install_dir : join_paths(get_option('sysconfdir'), 'OpenCL', 'vendors'),