forked from qt-creator/qt-creator
The Qt shared library for Windows desktop platform has been moved from Qul 2.3.0 to support MinGW toolchain. The updated library path needs to be configured correctly. Task-number: QTCREATORBUG-28303 Change-Id: I7cf8150bfb4a66731904ea49089849496305f22e Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
114 lines
3.2 KiB
C++
114 lines
3.2 KiB
C++
// Copyright (C) 2022 The Qt Company Ltd.
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
|
|
|
#include "mcutarget.h"
|
|
#include "mcukitmanager.h"
|
|
#include "mcupackage.h"
|
|
#include "mcusupportplugin.h"
|
|
|
|
#include <utils/algorithm.h>
|
|
|
|
using namespace Utils;
|
|
|
|
namespace McuSupport::Internal {
|
|
|
|
McuTarget::McuTarget(const QVersionNumber &qulVersion,
|
|
const Platform &platform,
|
|
OS os,
|
|
const Packages &packages,
|
|
const McuToolChainPackagePtr &toolChainPackage,
|
|
const McuPackagePtr &toolChainFilePackage,
|
|
int colorDepth)
|
|
: m_qulVersion(qulVersion)
|
|
, m_platform(platform)
|
|
, m_os(os)
|
|
, m_packages(packages)
|
|
, m_toolChainPackage(toolChainPackage)
|
|
, m_toolChainFilePackage(toolChainFilePackage)
|
|
, m_colorDepth(colorDepth)
|
|
{}
|
|
|
|
Packages McuTarget::packages() const
|
|
{
|
|
return m_packages;
|
|
}
|
|
|
|
McuToolChainPackagePtr McuTarget::toolChainPackage() const
|
|
{
|
|
return m_toolChainPackage;
|
|
}
|
|
|
|
McuPackagePtr McuTarget::toolChainFilePackage() const
|
|
{
|
|
return m_toolChainFilePackage;
|
|
}
|
|
|
|
McuTarget::OS McuTarget::os() const
|
|
{
|
|
return m_os;
|
|
}
|
|
|
|
McuTarget::Platform McuTarget::platform() const
|
|
{
|
|
return m_platform;
|
|
}
|
|
|
|
bool McuTarget::isValid() const
|
|
{
|
|
return Utils::allOf(packages(), [](const McuPackagePtr &package) {
|
|
package->updateStatus();
|
|
return package->isValidStatus();
|
|
});
|
|
}
|
|
|
|
QString McuTarget::desktopCompilerId() const
|
|
{
|
|
// MinGW shares CMake configuration with GCC
|
|
// and it is distinguished from MSVC by CMake compiler ID.
|
|
// This provides the compiler ID to set up a different Qul configuration
|
|
// for MSVC and MinGW.
|
|
if (m_toolChainPackage) {
|
|
switch (m_toolChainPackage->toolchainType()) {
|
|
case McuToolChainPackage::ToolChainType::MSVC:
|
|
return QLatin1String("msvc");
|
|
case McuToolChainPackage::ToolChainType::GCC:
|
|
case McuToolChainPackage::ToolChainType::MinGW:
|
|
return QLatin1String("gnu");
|
|
default:
|
|
return QLatin1String("unsupported");
|
|
}
|
|
}
|
|
return QLatin1String("invalid");
|
|
}
|
|
|
|
void McuTarget::printPackageProblems() const
|
|
{
|
|
for (auto package : packages()) {
|
|
package->updateStatus();
|
|
if (!package->isValidStatus())
|
|
printMessage(tr("Error creating kit for target %1, package %2: %3")
|
|
.arg(McuKitManager::generateKitNameFromTarget(this),
|
|
package->label(),
|
|
package->statusText()),
|
|
true);
|
|
if (package->status() == McuAbstractPackage::Status::ValidPackageMismatchedVersion)
|
|
printMessage(tr("Warning creating kit for target %1, package %2: %3")
|
|
.arg(McuKitManager::generateKitNameFromTarget(this),
|
|
package->label(),
|
|
package->statusText()),
|
|
false);
|
|
}
|
|
}
|
|
|
|
QVersionNumber McuTarget::qulVersion() const
|
|
{
|
|
return m_qulVersion;
|
|
}
|
|
|
|
int McuTarget::colorDepth() const
|
|
{
|
|
return m_colorDepth;
|
|
}
|
|
|
|
} // namespace McuSupport::Internal
|