forked from qt-creator/qt-creator
CMake: Use a setup function for kit aspects
Some connects() in the CMakeToolManager ctor triggered accesses to the s_instance there before it was assigned. Solve the issue by moving the triggering code (CMakeKitAspect setup) out of the class. Change-Id: Ied0fc6b0b0eb87c29503ecb20e337289edecd203 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -1279,7 +1279,7 @@ KitAspect *CMakeConfigurationKitAspect::createKitAspect(Kit *k)
|
|||||||
return cmakeConfigurationKitAspectFactory().createKitAspect(k);
|
return cmakeConfigurationKitAspectFactory().createKitAspect(k);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMakeKitAspect::createFactories()
|
void Internal::setupCMakeKitAspects()
|
||||||
{
|
{
|
||||||
cmakeKitAspectFactory();
|
cmakeKitAspectFactory();
|
||||||
cmakeGeneratorKitAspectFactory();
|
cmakeGeneratorKitAspectFactory();
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
friend class CMakeToolManager;
|
friend class CMakeToolManager;
|
||||||
static void createFactories();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class CMAKE_EXPORT CMakeGeneratorKitAspect
|
class CMAKE_EXPORT CMakeGeneratorKitAspect
|
||||||
@@ -70,4 +69,6 @@ public:
|
|||||||
static ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *k);
|
static ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *k);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
namespace Internal { void setupCMakeKitAspects(); }
|
||||||
|
|
||||||
} // CMakeProjectManager
|
} // CMakeProjectManager
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
#include "cmakeformatter.h"
|
#include "cmakeformatter.h"
|
||||||
#include "cmakeinstallstep.h"
|
#include "cmakeinstallstep.h"
|
||||||
#include "cmakelocatorfilter.h"
|
#include "cmakelocatorfilter.h"
|
||||||
|
#include "cmakekitaspect.h"
|
||||||
#include "cmakeparser.h"
|
#include "cmakeparser.h"
|
||||||
#include "cmakeproject.h"
|
#include "cmakeproject.h"
|
||||||
#include "cmakeprojectconstants.h"
|
#include "cmakeprojectconstants.h"
|
||||||
@@ -53,6 +54,7 @@ class CMakeProjectPlugin final : public ExtensionSystem::IPlugin
|
|||||||
setupCMakeToolManager(this);
|
setupCMakeToolManager(this);
|
||||||
|
|
||||||
setupCMakeSettingsPage();
|
setupCMakeSettingsPage();
|
||||||
|
setupCMakeKitAspects();
|
||||||
|
|
||||||
setupCMakeBuildConfiguration();
|
setupCMakeBuildConfiguration();
|
||||||
setupCMakeBuildStep();
|
setupCMakeBuildStep();
|
||||||
|
|||||||
@@ -18,13 +18,15 @@
|
|||||||
#include <projectexplorer/buildsystem.h>
|
#include <projectexplorer/buildsystem.h>
|
||||||
#include <projectexplorer/projecttree.h>
|
#include <projectexplorer/projecttree.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <stack>
|
|
||||||
#include <utils/environment.h>
|
#include <utils/environment.h>
|
||||||
#include <utils/pointeralgorithm.h>
|
#include <utils/pointeralgorithm.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <nanotrace/nanotrace.h>
|
#include <nanotrace/nanotrace.h>
|
||||||
|
|
||||||
|
#include <stack>
|
||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
@@ -186,8 +188,6 @@ CMakeToolManager::CMakeToolManager()
|
|||||||
|
|
||||||
setObjectName("CMakeToolManager");
|
setObjectName("CMakeToolManager");
|
||||||
ExtensionSystem::PluginManager::addObject(this);
|
ExtensionSystem::PluginManager::addObject(this);
|
||||||
|
|
||||||
CMakeKitAspect::createFactories();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CMakeToolManager::~CMakeToolManager()
|
CMakeToolManager::~CMakeToolManager()
|
||||||
|
|||||||
Reference in New Issue
Block a user