forked from qt-creator/qt-creator
CMake: Fix project parsing notification
This builds on top of 08677c0b01 and
fixes one more code path to go through a common entry/exit point.
Change-Id: I1d00fa9242f247028e5d3b0ef3b5fe1d3f4cb03d
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -25,14 +25,10 @@
|
||||
|
||||
#include "builddirreader.h"
|
||||
|
||||
#include "cmakebuildconfiguration.h"
|
||||
#include "cmakekitinformation.h"
|
||||
#include "servermodereader.h"
|
||||
#include "tealeafreader.h"
|
||||
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
@@ -43,57 +39,15 @@ namespace Internal {
|
||||
// BuildDirReader:
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
BuildDirReader::Parameters::Parameters() = default;
|
||||
|
||||
BuildDirReader::Parameters::Parameters(const CMakeBuildConfiguration *bc)
|
||||
BuildDirReader *BuildDirReader::createReader(const BuildDirParameters &p)
|
||||
{
|
||||
const ProjectExplorer::Kit *k = bc->target()->kit();
|
||||
|
||||
projectName = bc->target()->project()->displayName();
|
||||
|
||||
sourceDirectory = bc->target()->project()->projectDirectory();
|
||||
buildDirectory = bc->buildDirectory();
|
||||
|
||||
environment = bc->environment();
|
||||
|
||||
CMakeTool *cmake = CMakeKitInformation::cmakeTool(k);
|
||||
cmakeVersion = cmake->version();
|
||||
cmakeHasServerMode = cmake->hasServerMode();
|
||||
cmakeExecutable = cmake->cmakeExecutable();
|
||||
|
||||
pathMapper = cmake->pathMapper();
|
||||
isAutorun = cmake->isAutoRun();
|
||||
|
||||
auto tc = ProjectExplorer::ToolChainKitInformation::toolChain(k, ProjectExplorer::Constants::CXX_LANGUAGE_ID);
|
||||
if (tc)
|
||||
cxxToolChainId = tc->id();
|
||||
tc = ProjectExplorer::ToolChainKitInformation::toolChain(k, ProjectExplorer::Constants::C_LANGUAGE_ID);
|
||||
if (tc)
|
||||
cToolChainId = tc->id();
|
||||
sysRoot = ProjectExplorer::SysRootKitInformation::sysRoot(k);
|
||||
|
||||
expander = k->macroExpander();
|
||||
|
||||
configuration = bc->cmakeConfiguration();
|
||||
|
||||
generator = CMakeGeneratorKitInformation::generator(k);
|
||||
extraGenerator = CMakeGeneratorKitInformation::extraGenerator(k);
|
||||
platform = CMakeGeneratorKitInformation::platform(k);
|
||||
toolset = CMakeGeneratorKitInformation::toolset(k);
|
||||
generatorArguments = CMakeGeneratorKitInformation::generatorArguments(k);
|
||||
}
|
||||
|
||||
BuildDirReader::Parameters::Parameters(const BuildDirReader::Parameters &) = default;
|
||||
|
||||
|
||||
BuildDirReader *BuildDirReader::createReader(const BuildDirReader::Parameters &p)
|
||||
{
|
||||
if (p.cmakeHasServerMode)
|
||||
QTC_ASSERT(p.isValid() && p.cmakeTool, return nullptr);
|
||||
if (p.cmakeTool->hasServerMode())
|
||||
return new ServerModeReader;
|
||||
return new TeaLeafReader;
|
||||
}
|
||||
|
||||
void BuildDirReader::setParameters(const BuildDirReader::Parameters &p)
|
||||
void BuildDirReader::setParameters(const BuildDirParameters &p)
|
||||
{
|
||||
m_parameters = p;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user