summaryrefslogtreecommitdiff
path: root/media-libs/mesa/files/llvm-10.patch
blob: 1830455b57db1fe30d12f1fe31724c6411ca9caf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
From ff1a3a00cb37d84ab9a563f0aa241714876f56b4 Mon Sep 17 00:00:00 2001
From: Karol Herbst <kherbst@redhat.com>
Date: Thu, 2 Apr 2020 13:00:14 +0200
Subject: [PATCH] clover: fix build with single library clang build
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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>
---
 src/gallium/targets/opencl/meson.build | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

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,