ImportProject: Read system includes and standard from compile database

This commit is contained in:
Daniel Marjamäki 2017-08-03 20:33:56 +02:00
parent 1f3f8f6f20
commit ccea0b17b3
1 changed files with 12 additions and 0 deletions

View File

@ -227,6 +227,18 @@ void ImportProject::importCompileCommands(std::istream &istr)
fs.undefs.insert(fval);
else if (F=='I')
fs.includePaths.push_back(fval);
else if (F=='s' && fval.compare(0,3,"td=") == 0)
fs.standard = fval.substr(3);
else if (F == 'i' && fval == "system") {
++pos;
std::string isystem;
while (pos < command.size() && command[pos] != ' ') {
if (command[pos] != '\\')
isystem += command[pos];
pos++;
}
fs.systemIncludePaths.push_back(isystem);
}
}
std::map<std::string, std::string> variables;
fs.setIncludePaths(directory, fs.includePaths, variables);