forked from qt-creator/qt-creator
Clang: Save compilation database to the build directory
For example CMake puts compile_commands.json into the build directory and it makes sense because it uses some target-specific command line options. Change-Id: I92a5b391f35e3f75bbcf41b8efff448f197895bb Reviewed-by: Marco Bubke <marco.bubke@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -68,13 +68,12 @@ void ClangCodeModelPlugin::generateCompilationDB() {
|
||||
using namespace CppTools;
|
||||
|
||||
ProjectExplorer::Project *project = ProjectExplorer::SessionManager::startupProject();
|
||||
if (!project)
|
||||
if (!project || !project->activeTarget())
|
||||
return;
|
||||
|
||||
m_generatorWatcher.setFuture(QtConcurrent::run(
|
||||
&Utils::generateCompilationDB,
|
||||
project->projectDirectory(),
|
||||
CppModelManager::instance()->projectInfo(project)));
|
||||
m_generatorWatcher.setFuture(
|
||||
QtConcurrent::run(&Utils::generateCompilationDB,
|
||||
CppModelManager::instance()->projectInfo(project)));
|
||||
}
|
||||
|
||||
static bool isDBGenerationEnabled(ProjectExplorer::Project *project)
|
||||
|
||||
Reference in New Issue
Block a user