GetFallback: append clang.extraArgs

When compile_commands.json is absent, GetFallback is called to get
default clang command line when there is no .ccls or .ccls is empty.
This commit is contained in:
Fangrui Song 2019-02-10 11:58:18 +08:00
parent 8724985388
commit 6185d69d9d

View File

@ -227,6 +227,8 @@ std::vector<const char *> GetFallback(const std::string path) {
std::vector<const char *> argv{"clang"};
if (sys::path::extension(path) == ".h")
argv.push_back("-xobjective-c++-header");
for (const std::string &arg : g_config->clang.extraArgs)
argv.push_back(Intern(arg));
argv.push_back(Intern(path));
return argv;
}