From 6185d69d9d5c5a2aba3902ce7c95cc4f430abb20 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sun, 10 Feb 2019 11:58:18 +0800 Subject: [PATCH] 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. --- src/project.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/project.cc b/src/project.cc index 6833ad7b..717f81c6 100644 --- a/src/project.cc +++ b/src/project.cc @@ -227,6 +227,8 @@ std::vector GetFallback(const std::string path) { std::vector 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; }