forked from qt-creator/qt-creator
CMakeTool: Fix reading from SDKtool file
Change-Id: Ie1efbfe579c8d41ffd0795deaa3ee3759938862b Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
@@ -125,14 +125,12 @@ mergeTools(std::vector<std::unique_ptr<CMakeTool>> &sdkTools,
|
||||
std::vector<std::unique_ptr<CMakeTool>> &userTools,
|
||||
std::vector<std::unique_ptr<CMakeTool>> &autoDetectedTools)
|
||||
{
|
||||
std::vector<std::unique_ptr<CMakeTool>> result;
|
||||
std::vector<std::unique_ptr<CMakeTool>> result = std::move(sdkTools);
|
||||
while (userTools.size() > 0) {
|
||||
std::unique_ptr<CMakeTool> userTool = std::move(userTools[0]);
|
||||
userTools.erase(std::begin(userTools));
|
||||
|
||||
if (auto sdkTool = Utils::take(sdkTools, Utils::equal(&CMakeTool::id, userTool->id()))) {
|
||||
result.emplace_back(std::move(sdkTool.value()));
|
||||
} else {
|
||||
if (!Utils::contains(result, Utils::equal(&CMakeTool::id, userTool->id()))) {
|
||||
if (userTool->isAutoDetected()
|
||||
&& !Utils::contains(autoDetectedTools, Utils::equal(&CMakeTool::cmakeExecutable,
|
||||
userTool->cmakeExecutable()))) {
|
||||
|
||||
Reference in New Issue
Block a user