summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarol Herbst <kherbst@redhat.com>2020-04-02 13:00:14 +0200
committerEric Engestrom <eric@engestrom.ch>2020-04-19 15:39:30 +0200
commitb5b56d89a16760560bdb4aed03cc302882e7e544 (patch)
tree0bb7c58cfad178a9cdb5ac72f4f99e92cbe50775
parentfc140276b4b0352a07afd82fcc6517ff140186d6 (diff)
clover: fix build with single library clang build
Closes: #2560 Signed-off-by: Karol Herbst <kherbst@redhat.com> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4417> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4417> (cherry picked from commit ff1a3a00cb37d84ab9a563f0aa241714876f56b4)
-rw-r--r--.pick_status.json2
-rw-r--r--src/gallium/targets/opencl/meson.build26
2 files changed, 17 insertions, 11 deletions
diff --git a/.pick_status.json b/.pick_status.json
index 4dbb12bce16..3e17ce8a795 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -3901,7 +3901,7 @@
"description": "clover: fix build with single library clang build",
"nominated": false,
"nomination_type": null,
- "resolution": 4,
+ "resolution": 1,
"master_sha": null,
"because_sha": null
},
diff --git a/src/gallium/targets/opencl/meson.build b/src/gallium/targets/opencl/meson.build
index 907cc74337d..6ce01025d0b 100644
--- a/src/gallium/targets/opencl/meson.build
+++ b/src/gallium/targets/opencl/meson.build
@@ -33,16 +33,9 @@ llvm_libdir = dep_llvm.get_configtool_variable('libdir')
opencl_libname = with_opencl_icd ? 'MesaOpenCL' : 'OpenCL'
-libopencl = shared_library(
- opencl_libname,
- [],
- link_args : [ld_args_gc_sections, opencl_link_args],
- link_depends : opencl_link_deps,
- link_whole : libclover,
- link_with : [libpipe_loader_dynamic, libgallium],
- dependencies : [
- idep_mesautil,
- dep_clock, dep_dl, dep_unwind, dep_elf,
+dep_clang = cpp.find_library('clang-cpp', dirs : llvm_libdir, required : false)
+if not dep_clang.found()
+ dep_clang = [
cpp.find_library('clangCodeGen', dirs : llvm_libdir),
cpp.find_library('clangFrontendTool', dirs : llvm_libdir),
cpp.find_library('clangFrontend', dirs : llvm_libdir),
@@ -56,6 +49,19 @@ libopencl = shared_library(
cpp.find_library('clangEdit', dirs : llvm_libdir),
cpp.find_library('clangLex', dirs : llvm_libdir),
cpp.find_library('clangBasic', dirs : llvm_libdir),
+ ]
+endif
+
+libopencl = shared_library(
+ opencl_libname,
+ [],
+ link_args : [ld_args_gc_sections, opencl_link_args],
+ link_depends : opencl_link_deps,
+ link_whole : libclover,
+ link_with : [libpipe_loader_dynamic, libgallium],
+ dependencies : [
+ idep_mesautil,
+ dep_clock, dep_dl, dep_unwind, dep_elf, dep_clang
],
version : '@0@.0.0'.format(opencl_version),
install : true,