mirror of
https://github.com/MaskRay/ccls.git
synced 2025-02-07 17:32:14 +00:00
Address ODR violation spot by @Riatre and work around .o .a in compile_commands.json
This commit is contained in:
parent
4815b35ff9
commit
9b0256355e
@ -241,6 +241,11 @@ Project::Entry GetCompilationEntryFromCompileCommandEntry(
|
|||||||
// This is most likely the file path we will be passing to clang.
|
// This is most likely the file path we will be passing to clang.
|
||||||
if (EndsWith(arg, base_name))
|
if (EndsWith(arg, base_name))
|
||||||
arg = cleanup_maybe_relative_path(arg);
|
arg = cleanup_maybe_relative_path(arg);
|
||||||
|
// TODO Exclude .a .o to make link command in compile_commands.json work.
|
||||||
|
// Also, clang_parseTranslationUnit2FullArgv does not seem to accept
|
||||||
|
// multiple source filenames.
|
||||||
|
else if (EndsWith(arg, ".a") || EndsWith(arg, ".o"))
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
result.args.push_back(arg);
|
result.args.push_back(arg);
|
||||||
|
@ -357,11 +357,6 @@ Maybe<QueryVarId> GetQueryVarIdFromUsr(QueryDatabase* query_db,
|
|||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
template <>
|
|
||||||
bool Maybe<QueryLocation>::has_value() const {
|
|
||||||
return storage.range.start.line >= 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Maybe<QueryFileId> QueryDatabase::GetQueryFileIdFromPath(
|
Maybe<QueryFileId> QueryDatabase::GetQueryFileIdFromPath(
|
||||||
const std::string& path) {
|
const std::string& path) {
|
||||||
return ::GetQueryFileIdFromPath(this, path, false);
|
return ::GetQueryFileIdFromPath(this, path, false);
|
||||||
|
Loading…
Reference in New Issue
Block a user