mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-25 15:40:46 +02:00
clover: Fix MSVC build
Guard the include of dlfcn.h with HAVE_DLFCN_H. Use the FALLBACK_CLANG_RESOURCE_DIR if it is not available. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33869>
This commit is contained in:
parent
7cd0ced50d
commit
92638e543b
1 changed files with 6 additions and 0 deletions
|
|
@ -24,7 +24,9 @@
|
|||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
#ifdef HAVE_DLFCN_H
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
#include <llvm/IR/DiagnosticPrinter.h>
|
||||
#include <llvm/IR/DiagnosticInfo.h>
|
||||
|
|
@ -328,6 +330,7 @@ namespace {
|
|||
}
|
||||
|
||||
std::string getResourceDirectory() {
|
||||
#ifdef HAVE_DLFCN_H
|
||||
Dl_info info;
|
||||
if (dladdr((void *)clang::CompilerInvocation::CreateFromArgs, &info) == 0) {
|
||||
return FALLBACK_CLANG_RESOURCE_DIR;
|
||||
|
|
@ -349,6 +352,9 @@ namespace {
|
|||
free(libclang_path);
|
||||
|
||||
return clang_resource_dir;
|
||||
#else
|
||||
return FALLBACK_CLANG_RESOURCE_DIR;
|
||||
#endif
|
||||
}
|
||||
|
||||
std::unique_ptr<Module>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue