Skip to content

Commit bda802c

Browse files
authored
Merge pull request #23809 from jmittert/SourceLibNotSourceBin
2 parents e922d29 + 4cf30b8 commit bda802c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tools/SourceKit/tools/sourcekitd/bin/InProc/sourcekitdInProc.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "SourceKit/Support/Concurrency.h"
1616
#include "SourceKit/Support/UIdent.h"
1717

18+
#include "llvm/ADT/SmallString.h"
1819
#include "llvm/Support/Mutex.h"
1920
#include "llvm/Support/Path.h"
2021

@@ -82,14 +83,17 @@ UIdent sourcekitd::UIdentFromSKDUID(sourcekitd_uid_t uid) {
8283
std::string sourcekitd::getRuntimeLibPath() {
8384
#if defined(_WIN32)
8485
MEMORY_BASIC_INFORMATION mbi;
86+
llvm::SmallString<128> libPath;
8587
char path[MAX_PATH + 1];
8688
if (!VirtualQuery(static_cast<void *>(sourcekitd_initialize), &mbi,
8789
sizeof(mbi)))
8890
llvm_unreachable("call to VirtualQuery failed");
8991
if (!GetModuleFileNameA(static_cast<HINSTANCE>(mbi.AllocationBase), path,
9092
MAX_PATH))
9193
llvm_unreachable("call to GetModuleFileNameA failed");
92-
return llvm::sys::path::parent_path(path);
94+
libPath = llvm::sys::path::parent_path(llvm::sys::path::parent_path(path));
95+
llvm::sys::path::append(libPath, "lib");
96+
return libPath.str();
9397
#else
9498
// This silly cast below avoids a C++ warning.
9599
Dl_info info;

0 commit comments

Comments
 (0)