File tree Expand file tree Collapse file tree 1 file changed +1
-13
lines changed Expand file tree Collapse file tree 1 file changed +1
-13
lines changed Original file line number Diff line number Diff line change @@ -425,14 +425,13 @@ void Project::loadDirectory(const std::string &root, Project::Folder &folder) {
425
425
} else {
426
426
LOG_S (INFO) << " loaded " << path.c_str ();
427
427
for (tooling::CompileCommand &cmd : cdb->getAllCompileCommands ()) {
428
- static bool once;
429
428
Project::Entry entry;
430
429
entry.root = root;
431
430
doPathMapping (entry.root );
432
431
433
432
// If workspace folder is real/ but entries use symlink/, convert to
434
433
// real/.
435
- entry.directory = realPath (cmd.Directory );
434
+ entry.directory = realPath (resolveIfRelative (root, cmd.Directory ) );
436
435
entry.directory .push_back (' /' );
437
436
normalizeFolder (entry.directory );
438
437
entry.directory .pop_back ();
@@ -450,18 +449,7 @@ void Project::loadDirectory(const std::string &root, Project::Folder &folder) {
450
449
entry.args .push_back (intern (args[i]));
451
450
}
452
451
entry.compdb_size = entry.args .size ();
453
-
454
- // Work around relative --sysroot= as it isn't affected by
455
- // -working-directory=. chdir is thread hostile but this function runs
456
- // before indexers do actual work and it works when there is only one
457
- // workspace folder.
458
- if (!once) {
459
- once = true ;
460
- llvm::vfs::getRealFileSystem ()->setCurrentWorkingDirectory (
461
- entry.directory );
462
- }
463
452
proc.getSearchDirs (entry);
464
-
465
453
if (seen.insert (entry.filename ).second )
466
454
folder.entries .push_back (entry);
467
455
}
You can’t perform that action at this time.
0 commit comments