forked from qt-creator/qt-creator
ClangCodeModel: Speed up compilation db generation
We needlessly re-evaluated the same compiler options again and again for all files in a project part. Now we only do the actual file-related work per file. Along the way, we dissolved some unneeded classes and made CompilerOptionsBuilder non- polymorphic. Change-Id: I9710d641a57032936cc0812515974dbc91676c8c Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -80,11 +80,13 @@ void ClangCodeModelPlugin::generateCompilationDB()
|
||||
if (!projectInfo)
|
||||
return;
|
||||
|
||||
const CppEditor::ClangDiagnosticConfig warningsConfig
|
||||
= warningsConfigForProject(target->project());
|
||||
QFuture<GenerateCompilationDbResult> task
|
||||
= QtConcurrent::run(&Internal::generateCompilationDB, projectInfo,
|
||||
projectInfo->buildRoot(), CompilationDbPurpose::Project,
|
||||
warningsConfigForProject(target->project()),
|
||||
optionsForProject(target->project()));
|
||||
warningsConfig,
|
||||
optionsForProject(target->project(), warningsConfig));
|
||||
Core::ProgressManager::addTask(task, tr("Generating Compilation DB"), "generate compilation db");
|
||||
m_generatorWatcher.setFuture(task);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user