mirror of
https://github.com/MaskRay/ccls.git
synced 2025-01-31 09:50:26 +00:00
Fix argument handling for chrome
This commit is contained in:
parent
3003385d76
commit
0e7c8bdf05
@ -33,7 +33,7 @@ TranslationUnit::TranslationUnit(Index* index,
|
||||
// index->cx_index, filepath.c_str(), args.size(), args.data(),
|
||||
// (unsigned)unsaved_files.size(), unsaved_files.data());
|
||||
|
||||
CXErrorCode error_code = clang_parseTranslationUnit2(
|
||||
CXErrorCode error_code = clang_parseTranslationUnit2FullArgv(
|
||||
index->cx_index, filepath.c_str(), args.data(), (int)args.size(),
|
||||
unsaved_files.data(), (unsigned)unsaved_files.size(), flags, &cx_tu);
|
||||
|
||||
|
@ -44,17 +44,11 @@ static const char* kBlacklist[] = {
|
||||
"-MP",
|
||||
"-MD",
|
||||
"-MMD",
|
||||
"--fcolor-diagnostics"
|
||||
"--fcolor-diagnostics",
|
||||
|
||||
//"-s",
|
||||
|
||||
"-B",
|
||||
//"-f",
|
||||
//"-pipe",
|
||||
//"-W",
|
||||
// This strips path-like args but is a bit hacky.
|
||||
// TODO: make sure we consume includes before stripping all path-like args.
|
||||
//"/", "..",
|
||||
//"-stdlib=libc++"
|
||||
"/", "..",
|
||||
};
|
||||
|
||||
// Arguments which are followed by a potentially relative path. We need to make
|
||||
@ -103,6 +97,9 @@ Project::Entry GetCompilationEntryFromCompileCommandEntry(
|
||||
// correct parsing for command lines like "goma clang -c foo".
|
||||
while (i < entry.args.size() && entry.args[i][0] != '-')
|
||||
++i;
|
||||
// Include the compiler in the args.
|
||||
if (i > 0)
|
||||
--i;
|
||||
|
||||
bool make_next_flag_absolute = false;
|
||||
bool add_next_flag_quote = false;
|
||||
|
Loading…
Reference in New Issue
Block a user