forked from qt-creator/qt-creator
MesonProjectManager: fix loading previously configured projects
File watcher was not looking in build dir and wasn't updated when build
directory changed.
Also parsing should only happen on active build configurations.
Task-number: QTCREATORBUG-33071
Change-Id: I0c1ce95729472a7c08e029a322b7213acfe9c2f1
Reviewed-by: hjk <hjk@qt.io>
(cherry picked from commit 54a0c74ff8
)
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
committed by
Eike Ziller
parent
ee57084299
commit
4983f08c47
@@ -206,10 +206,8 @@ MesonBuildSystem::MesonBuildSystem(BuildConfiguration *bc)
|
|||||||
connect(bc, &BuildConfiguration::kitChanged, this, [this] {
|
connect(bc, &BuildConfiguration::kitChanged, this, [this] {
|
||||||
updateKit(kit());
|
updateKit(kit());
|
||||||
});
|
});
|
||||||
connect(bc, &MesonBuildConfiguration::buildDirectoryChanged, this, [this] {
|
connect(bc, &MesonBuildConfiguration::buildDirectoryChanged, this,
|
||||||
updateKit(kit());
|
&MesonBuildSystem::buildDirectoryChanged);
|
||||||
this->triggerParsing();
|
|
||||||
});
|
|
||||||
connect(qobject_cast<MesonBuildConfiguration *>(bc),
|
connect(qobject_cast<MesonBuildConfiguration *>(bc),
|
||||||
&MesonBuildConfiguration::parametersChanged, this, [this] {
|
&MesonBuildConfiguration::parametersChanged, this, [this] {
|
||||||
updateKit(kit());
|
updateKit(kit());
|
||||||
@@ -231,14 +229,6 @@ MesonBuildSystem::MesonBuildSystem(BuildConfiguration *bc)
|
|||||||
});
|
});
|
||||||
|
|
||||||
updateKit(kit());
|
updateKit(kit());
|
||||||
// as specified here https://mesonbuild.com/IDE-integration.html#ide-integration
|
|
||||||
// meson-info.json is the last written file, which ensure that all others introspection
|
|
||||||
// files are ready when a modification is detected on this one.
|
|
||||||
m_IntroWatcher.addFile(buildConfiguration()
|
|
||||||
->buildDirectory()
|
|
||||||
.pathAppended(Constants::MESON_INFO_DIR)
|
|
||||||
.pathAppended(Constants::MESON_INFO),
|
|
||||||
Utils::FileSystemWatcher::WatchModifiedDate);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MesonBuildSystem::~MesonBuildSystem()
|
MesonBuildSystem::~MesonBuildSystem()
|
||||||
@@ -296,6 +286,24 @@ QStringList MesonBuildSystem::configArgs(bool isSetup)
|
|||||||
+ m_pendingConfigArgs + bc->mesonConfigArgs();
|
+ m_pendingConfigArgs + bc->mesonConfigArgs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MesonBuildSystem::buildDirectoryChanged()
|
||||||
|
{
|
||||||
|
updateKit(kit());
|
||||||
|
m_IntroWatcher.clear();
|
||||||
|
if (buildConfiguration()->isActive())
|
||||||
|
{
|
||||||
|
// as specified here https://mesonbuild.com/IDE-integration.html#ide-integration
|
||||||
|
// meson-info.json is the last written file, which ensure that all others introspection
|
||||||
|
// files are ready when a modification is detected on this one.
|
||||||
|
m_IntroWatcher.addFile(buildConfiguration()
|
||||||
|
->buildDirectory()
|
||||||
|
.pathAppended(Constants::MESON_INFO_DIR)
|
||||||
|
.pathAppended(Constants::MESON_INFO),
|
||||||
|
Utils::FileSystemWatcher::WatchModifiedDate);
|
||||||
|
}
|
||||||
|
this->triggerParsing();
|
||||||
|
}
|
||||||
|
|
||||||
bool MesonBuildSystem::configure()
|
bool MesonBuildSystem::configure()
|
||||||
{
|
{
|
||||||
LEAVE_IF_BUSY();
|
LEAVE_IF_BUSY();
|
||||||
@@ -337,6 +345,8 @@ bool MesonBuildSystem::wipe()
|
|||||||
bool MesonBuildSystem::parseProject()
|
bool MesonBuildSystem::parseProject()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(buildConfiguration(), return false);
|
QTC_ASSERT(buildConfiguration(), return false);
|
||||||
|
if (!buildConfiguration()->isActive()) // Never parse if not active
|
||||||
|
return false;
|
||||||
if (!isSetup(buildConfiguration()->buildDirectory()) && settings().autorunMeson())
|
if (!isSetup(buildConfiguration()->buildDirectory()) && settings().autorunMeson())
|
||||||
return configure();
|
return configure();
|
||||||
LEAVE_IF_BUSY();
|
LEAVE_IF_BUSY();
|
||||||
|
@@ -42,6 +42,7 @@ private:
|
|||||||
bool needsSetup();
|
bool needsSetup();
|
||||||
void parsingCompleted(bool success);
|
void parsingCompleted(bool success);
|
||||||
QStringList configArgs(bool isSetup);
|
QStringList configArgs(bool isSetup);
|
||||||
|
void buildDirectoryChanged();
|
||||||
|
|
||||||
ProjectExplorer::BuildSystem::ParseGuard m_parseGuard;
|
ProjectExplorer::BuildSystem::ParseGuard m_parseGuard;
|
||||||
MesonProjectParser m_parser;
|
MesonProjectParser m_parser;
|
||||||
|
Reference in New Issue
Block a user