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 520991c009
commit 8f9973f03c

View File

@ -215,6 +215,8 @@ std::vector<const char *> GetFallback(const std::string path) {
std::vector<const char *> argv{"clang"}; std::vector<const char *> argv{"clang"};
if (sys::path::extension(path) == ".h") if (sys::path::extension(path) == ".h")
argv.push_back("-xobjective-c++-header"); 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)); argv.push_back(Intern(path));
return argv; return argv;
} }