compiler/clc: Fix embedded clang headers (microsoft-clc) for LLVM 16+

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7742

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22741>
(cherry picked from commit f53e5efad7)
This commit is contained in:
Lone_Wolf 2023-04-27 19:42:02 +02:00 committed by Dylan Baker
parent 78a37a4b87
commit 9743eeabc7
2 changed files with 12 additions and 2 deletions

View file

@ -8514,7 +8514,7 @@
"description": "compiler/clc: Fix embedded clang headers (microsoft-clc) for LLVM 16+",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -29,7 +29,17 @@ _libclc_cpp_args = ['-DLLVM_LIB_DIR="@0@"'.format(llvm_libdir)]
_libclc_sources = []
if with_microsoft_clc
clang_resource_dir = join_paths(llvm_libdir, 'clang', dep_llvm.version(), 'include')
# LLVM 16 moved clang header path from using full version to only major version
if dep_llvm.version().version_compare('< 16')
# Prior to LLVM 16, this path used a full version
clang_version_dir = dep_llvm.version()
else
# LLVM 16 changed to only using a major version
clang_version_dir = dep_llvm.version().split('.')[0]
endif
clang_resource_dir = join_paths(llvm_libdir, 'clang', clang_version_dir, 'include')
if dep_llvm.version().version_compare('< 15.0')
opencl_c_h = custom_target(
'opencl-c.h',