nixpkgs/pkgs/development/libraries/mesa/opencl.patch

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

98 lines
3.7 KiB
Diff
Raw Normal View History

2022-12-02 15:15:42 +00:00
diff --git a/meson.build b/meson.build
index e32338b3f9a..fae804fd41e 100644
--- a/meson.build
+++ b/meson.build
@@ -1894,7 +1894,7 @@ endif
dep_clang = null_dep
if with_clc
- llvm_libdir = dep_llvm.get_variable(cmake : 'LLVM_LIBRARY_DIR', configtool: 'libdir')
+ llvm_libdir = get_option('clang-libdir')
dep_clang = cpp.find_library('clang-cpp', dirs : llvm_libdir, required : false)
diff --git a/meson_options.txt b/meson_options.txt
2022-12-02 15:15:42 +00:00
index 6f307018815..ab84eb1006c 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -18,6 +18,12 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
+option(
+ 'clang-libdir',
+ type : 'string',
+ value : '',
+ description : 'Locations to search for clang libraries.'
+)
option(
'platforms',
type : 'array',
diff --git a/src/gallium/targets/opencl/meson.build b/src/gallium/targets/opencl/meson.build
2022-12-02 15:15:42 +00:00
index 7af210b5693..ff6ac8c61ca 100644
--- a/src/gallium/targets/opencl/meson.build
+++ b/src/gallium/targets/opencl/meson.build
@@ -30,6 +30,7 @@ if with_ld_version_script
endif
llvm_libdir = dep_llvm.get_variable(cmake : 'LLVM_LIBRARY_DIR', configtool: 'libdir')
+clang_libdir = get_option('clang-libdir')
opencl_libname = with_opencl_icd ? 'MesaOpenCL' : 'OpenCL'
polly_dep = null_dep
@@ -60,19 +61,19 @@ else
endif
2022-12-02 15:15:42 +00:00
if not _shared_llvm or not (dep_clang.found() and dep_clang_usable)
dep_clang = [
- cpp.find_library('clangCodeGen', dirs : llvm_libdir),
- cpp.find_library('clangFrontendTool', dirs : llvm_libdir),
- cpp.find_library('clangFrontend', dirs : llvm_libdir),
- cpp.find_library('clangDriver', dirs : llvm_libdir),
- cpp.find_library('clangSerialization', dirs : llvm_libdir),
- cpp.find_library('clangParse', dirs : llvm_libdir),
- cpp.find_library('clangSema', dirs : llvm_libdir),
- cpp.find_library('clangAnalysis', dirs : llvm_libdir),
- cpp.find_library('clangAST', dirs : llvm_libdir),
- cpp.find_library('clangASTMatchers', dirs : llvm_libdir),
- cpp.find_library('clangEdit', dirs : llvm_libdir),
- cpp.find_library('clangLex', dirs : llvm_libdir),
- cpp.find_library('clangBasic', dirs : llvm_libdir),
+ cpp.find_library('clangCodeGen', dirs : clang_libdir),
+ cpp.find_library('clangFrontendTool', dirs : clang_libdir),
+ cpp.find_library('clangFrontend', dirs : clang_libdir),
+ cpp.find_library('clangDriver', dirs : clang_libdir),
+ cpp.find_library('clangSerialization', dirs : clang_libdir),
+ cpp.find_library('clangParse', dirs : clang_libdir),
+ cpp.find_library('clangSema', dirs : clang_libdir),
+ cpp.find_library('clangAnalysis', dirs : clang_libdir),
+ cpp.find_library('clangAST', dirs : clang_libdir),
+ cpp.find_library('clangASTMatchers', dirs : clang_libdir),
+ cpp.find_library('clangEdit', dirs : clang_libdir),
+ cpp.find_library('clangLex', dirs : clang_libdir),
+ cpp.find_library('clangBasic', dirs : clang_libdir),
polly_dep, polly_isl_dep,
]
# check clang once more
2022-12-02 15:15:42 +00:00
@@ -119,7 +120,7 @@ if with_opencl_icd
configuration : _config,
input : 'mesa.icd.in',
output : 'mesa.icd',
2022-12-02 15:15:42 +00:00
- install : true,
+ install : false,
install_dir : join_paths(get_option('sysconfdir'), 'OpenCL', 'vendors'),
)
2022-09-21 12:36:02 +00:00
2022-12-02 15:15:42 +00:00
diff --git a/src/gallium/targets/rusticl/meson.build b/src/gallium/targets/rusticl/meson.build
index a968dee52db..69475cf3133 100644
--- a/src/gallium/targets/rusticl/meson.build
+++ b/src/gallium/targets/rusticl/meson.build
@@ -58,7 +58,7 @@ configure_file(
configuration : _config,
input : 'rusticl.icd.in',
output : 'rusticl.icd',
- install : true,
+ install : false,
install_dir : join_paths(get_option('sysconfdir'), 'OpenCL', 'vendors'),
)