mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 13:50:11 +01:00
OpenCL/draw module: Support linking with LLVM and clang 15 static libraries
Cc: mesa-stable Closes: #7243 Closes: #7487 Reviewed-by: Karol Herbst <kherbst@redhat.com> Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19009>
This commit is contained in:
parent
83617f4a57
commit
f69b43ae3e
2 changed files with 15 additions and 2 deletions
13
meson.build
13
meson.build
|
|
@ -1785,15 +1785,21 @@ if with_gallium_opencl
|
||||||
'linker', 'coverage', 'instrumentation', 'ipo', 'irreader',
|
'linker', 'coverage', 'instrumentation', 'ipo', 'irreader',
|
||||||
'lto', 'option', 'objcarcopts', 'profiledata'
|
'lto', 'option', 'objcarcopts', 'profiledata'
|
||||||
]
|
]
|
||||||
llvm_optional_modules += ['all-targets', 'frontendopenmp']
|
# all-targets is needed to support static linking LLVM build with multiple targets
|
||||||
|
# windowsdriver is needded with LLVM>=15, but we don't know what LLVM verrsion we are using yet
|
||||||
|
llvm_optional_modules += ['all-targets', 'frontendopenmp', 'windowsdriver']
|
||||||
endif
|
endif
|
||||||
if with_clc
|
if with_clc
|
||||||
llvm_modules += ['coverage', 'target', 'linker', 'irreader', 'option', 'libdriver', 'lto']
|
llvm_modules += ['coverage', 'target', 'linker', 'irreader', 'option', 'libdriver', 'lto']
|
||||||
llvm_optional_modules += ['all-targets']
|
# all-targets is needed to support static linking LLVM build with multiple targets
|
||||||
|
# windowsdriver is needded with LLVM>=15, but we don't know what LLVM verrsion we are using yet
|
||||||
|
llvm_optional_modules += ['all-targets', 'windowsdriver']
|
||||||
endif
|
endif
|
||||||
draw_with_llvm = get_option('draw-use-llvm')
|
draw_with_llvm = get_option('draw-use-llvm')
|
||||||
if draw_with_llvm
|
if draw_with_llvm
|
||||||
llvm_modules += 'native'
|
llvm_modules += 'native'
|
||||||
|
# lto is needded with LLVM>=15, but we don't know what LLVM verrsion we are using yet
|
||||||
|
llvm_optional_modules += ['lto']
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if with_intel_clc
|
if with_intel_clc
|
||||||
|
|
@ -1951,6 +1957,9 @@ if with_clc
|
||||||
'clangHandleCXX', 'clangHandleLLVM', 'clangSerialization',
|
'clangHandleCXX', 'clangHandleLLVM', 'clangSerialization',
|
||||||
'clangSema', 'clangParse', 'clangEdit', 'clangAnalysis'
|
'clangSema', 'clangParse', 'clangEdit', 'clangAnalysis'
|
||||||
]
|
]
|
||||||
|
if dep_llvm.version().version_compare('>= 15.0')
|
||||||
|
clang_modules += 'clangSupport'
|
||||||
|
endif
|
||||||
|
|
||||||
dep_clang = []
|
dep_clang = []
|
||||||
foreach m : clang_modules
|
foreach m : clang_modules
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,10 @@ if not _shared_llvm or not (dep_clang.found() and dep_clang_usable)
|
||||||
cpp.find_library('clangBasic', dirs : llvm_libdir),
|
cpp.find_library('clangBasic', dirs : llvm_libdir),
|
||||||
polly_dep, polly_isl_dep,
|
polly_dep, polly_isl_dep,
|
||||||
]
|
]
|
||||||
|
if dep_llvm.version().version_compare('>= 15.0')
|
||||||
|
dep_clang += cpp.find_library('clangSupport', dirs : llvm_libdir)
|
||||||
|
endif
|
||||||
|
|
||||||
# check clang once more
|
# check clang once more
|
||||||
if can_check_clang
|
if can_check_clang
|
||||||
test_run = cpp.run(clang_test_code, name : 'dep-clang-usable',
|
test_run = cpp.run(clang_test_code, name : 'dep-clang-usable',
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue