mirror of
https://github.com/MaskRay/ccls.git
synced 2025-06-08 01:04:54 +00:00
Allow absolute path for compilationDatabaseDirectory
This commit is contained in:
parent
b7d9ced086
commit
560babbbfd
@ -46,6 +46,7 @@ limitations under the License.
|
|||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <filesystem>
|
||||||
|
|
||||||
using namespace clang;
|
using namespace clang;
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
@ -331,10 +332,12 @@ void Project::LoadDirectory(const std::string &root, Project::Folder &folder) {
|
|||||||
std::string err_msg;
|
std::string err_msg;
|
||||||
folder.entries.clear();
|
folder.entries.clear();
|
||||||
if (g_config->compilationDatabaseCommand.empty()) {
|
if (g_config->compilationDatabaseCommand.empty()) {
|
||||||
CDBDir = root;
|
if (g_config->compilationDatabaseDirectory.size()) {
|
||||||
if (g_config->compilationDatabaseDirectory.size())
|
if (std::filesystem::path(g_config->compilationDatabaseDirectory).is_relative())
|
||||||
sys::path::append(CDBDir, g_config->compilationDatabaseDirectory);
|
sys::path::append(CDBDir, g_config->compilationDatabaseDirectory);
|
||||||
sys::path::append(Path, CDBDir, "compile_commands.json");
|
else
|
||||||
|
CDBDir = g_config->compilationDatabaseDirectory;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// If `compilationDatabaseCommand` is specified, execute it to get the
|
// If `compilationDatabaseCommand` is specified, execute it to get the
|
||||||
// compdb.
|
// compdb.
|
||||||
|
Loading…
Reference in New Issue
Block a user