CompilationDatabase: Add target to the compilation database project

Target exposes information about kit and toolchain to the outside
and enables tools like Clang-Tidy and Clazy.

Change-Id: I27b73bbb3b810789f6ca3d447b744604f8e61286
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Ivan Donchevskii
2018-11-01 15:10:52 +01:00
parent 5f008c9cfd
commit 38d39fb9f0

View File

@@ -37,6 +37,7 @@
#include <projectexplorer/kitmanager.h> #include <projectexplorer/kitmanager.h>
#include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/projectnodes.h> #include <projectexplorer/projectnodes.h>
#include <projectexplorer/target.h>
#include <projectexplorer/toolchainconfigwidget.h> #include <projectexplorer/toolchainconfigwidget.h>
#include <projectexplorer/toolchainmanager.h> #include <projectexplorer/toolchainmanager.h>
#include <texteditor/textdocument.h> #include <texteditor/textdocument.h>
@@ -301,6 +302,8 @@ void CompilationDatabaseProject::buildTreeAndProjectParts(const Utils::FileName
setRootProjectNode(std::move(root)); setRootProjectNode(std::move(root));
addTarget(createTarget(m_kit.get()));
m_cppCodeModelUpdater->update({this, cToolchain, cxxToolchain, m_kit.get(), rpps}); m_cppCodeModelUpdater->update({this, cToolchain, cxxToolchain, m_kit.get(), rpps});
emitParsingFinished(true); emitParsingFinished(true);