Skip to content

Commit

Permalink
project: allow absolute compilationDatabaseDirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
MaskRay committed Nov 10, 2019
1 parent 5200f43 commit 373e502
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/project.cc
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,12 @@ void Project::LoadDirectory(const std::string &root, Project::Folder &folder) {
folder.entries.clear();
if (g_config->compilationDatabaseCommand.empty()) {
CDBDir = root;
if (g_config->compilationDatabaseDirectory.size())
sys::path::append(CDBDir, g_config->compilationDatabaseDirectory);
if (g_config->compilationDatabaseDirectory.size()) {
if (sys::path::is_absolute(g_config->compilationDatabaseDirectory))
CDBDir = g_config->compilationDatabaseDirectory;
else
sys::path::append(CDBDir, g_config->compilationDatabaseDirectory);
}
sys::path::append(Path, CDBDir, "compile_commands.json");
} else {
// If `compilationDatabaseCommand` is specified, execute it to get the
Expand Down

0 comments on commit 373e502

Please sign in to comment.