forked from qt-creator/qt-creator
Clang: Add compiler name to each compilation database entry
In all examples there's a compiler as a first argument. Change-Id: I37ec4073254d68f29357e9b2447a035a1b15e02f Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
@@ -330,11 +330,13 @@ static QJsonObject createFileObject(CompilerOptionsBuilder &optionsBuilder,
|
||||
const ProjectFile &projFile,
|
||||
const ::Utils::FileName &buildDir)
|
||||
{
|
||||
optionsBuilder.updateLanguageOption(ProjectFile::classify(projFile.path));
|
||||
const ProjectFile::Kind kind = ProjectFile::classify(projFile.path);
|
||||
optionsBuilder.updateLanguageOption(kind);
|
||||
|
||||
QJsonObject fileObject;
|
||||
fileObject["file"] = projFile.path;
|
||||
QJsonArray args = QJsonArray::fromStringList(optionsBuilder.options());
|
||||
args.prepend(kind == ProjectFile::CXXSource ? "clang++" : "clang");
|
||||
args.append(QDir::toNativeSeparators(projFile.path));
|
||||
fileObject["arguments"] = args;
|
||||
fileObject["directory"] = buildDir.toString();
|
||||
|
||||
Reference in New Issue
Block a user