clc: fix compilation error with llvm-20
LLVM commit:
924a7d83b4
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11814
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: David Heidelberg <david@ixit.cz>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30980>
This commit is contained in:
@@ -886,10 +886,16 @@ clc_compile_to_llvm_module(LLVMContext &llvm_ctx,
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetResourcePath is a way to retrive the actual libclang resource dir based on a given binary
|
// GetResourcePath is a way to retrieve the actual libclang resource dir based on a given binary
|
||||||
// or library.
|
// or library.
|
||||||
auto clang_res_path =
|
auto tmp_res_path =
|
||||||
fs::path(Driver::GetResourcesPath(std::string(clang_path), CLANG_RESOURCE_DIR)) / "include";
|
#if LLVM_VERSION_MAJOR >= 20
|
||||||
|
Driver::GetResourcesPath(std::string(clang_path));
|
||||||
|
#else
|
||||||
|
Driver::GetResourcesPath(std::string(clang_path), CLANG_RESOURCE_DIR);
|
||||||
|
#endif
|
||||||
|
auto clang_res_path = fs::path(tmp_res_path) / "include";
|
||||||
|
|
||||||
free(clang_path);
|
free(clang_path);
|
||||||
|
|
||||||
c->getHeaderSearchOpts().UseBuiltinIncludes = true;
|
c->getHeaderSearchOpts().UseBuiltinIncludes = true;
|
||||||
|
Reference in New Issue
Block a user