forked from qt-creator/qt-creator
CMake: Do not remove "Current executable" target
The "Current executable" target is an artificial target added by Qt
Creator, so we must not remove it because it is not one of the targets
from the project.
Amends dbb5a70f93
Fixes: QTCREATORBUG-24145
Change-Id: I4601bcbc7238c6bf54bc9aa3ef6eb934b65df96e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -539,7 +539,9 @@ void CMakeBuildStep::recreateBuildTargetsModel()
|
|||||||
// Remove the targets that do not exist in the build system
|
// Remove the targets that do not exist in the build system
|
||||||
// This can result when selected targets get renamed
|
// This can result when selected targets get renamed
|
||||||
if (!targetList.empty()) {
|
if (!targetList.empty()) {
|
||||||
Utils::erase(m_buildTargets, [targetList](const QString &bt) { return !targetList.contains(bt); });
|
Utils::erase(m_buildTargets, [targetList](const QString &bt) {
|
||||||
|
return !bt.isEmpty() /* "current executable" */ && !targetList.contains(bt);
|
||||||
|
});
|
||||||
if (m_buildTargets.empty())
|
if (m_buildTargets.empty())
|
||||||
m_buildTargets.push_back(m_allTarget);
|
m_buildTargets.push_back(m_allTarget);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user