forked from qt-creator/qt-creator
SdkTool: Add --builddevice option
Useful in a docker context. Change-Id: I297654a9d65da2ce7d89b4ed8322d2ea0c80b3a2 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -62,6 +62,7 @@ const char DEBUGGER_ENGINE[] = "EngineType";
|
||||
const char DEBUGGER_BINARY[] = "Binary";
|
||||
const char DEVICE_TYPE[] = "PE.Profile.DeviceType";
|
||||
const char DEVICE_ID[] = "PE.Profile.Device";
|
||||
const char BUILDDEVICE_ID[] = "PE.Profile.BuildDevice";
|
||||
const char SYSROOT[] = "PE.Profile.SysRoot";
|
||||
const char TOOLCHAIN[] = "PE.Profile.ToolChainsV3";
|
||||
const char MKSPEC[] = "QtPM4.mkSpecInformation";
|
||||
@@ -90,8 +91,9 @@ QString AddKitOperation::argumentsHelpText() const
|
||||
" (not compatible with --debugger and --debuggerengine)\n"
|
||||
" --debuggerengine <ENGINE> debuggerengine of the new kit.\n"
|
||||
" --debugger <PATH> debugger of the new kit.\n"
|
||||
" --devicetype <TYPE> device type of the new kit (required).\n"
|
||||
" --device <ID> device id to use (optional).\n"
|
||||
" --devicetype <TYPE> (run-)device type of the new kit (required).\n"
|
||||
" --device <ID> (run-)device id to use (optional).\n"
|
||||
" --builddevice <ID> build device id to use (optional).\n"
|
||||
" --sysroot <PATH> sysroot of the new kit.\n"
|
||||
" --toolchain <ID> tool chain of the new kit (obsolete!).\n"
|
||||
" --<LANG>toolchain <ID> tool chain for a language.\n"
|
||||
@@ -180,6 +182,14 @@ bool AddKitOperation::setArguments(const QStringList &args)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (current == "--builddevice") {
|
||||
if (next.isNull())
|
||||
return false;
|
||||
++i; // skip next;
|
||||
m_buildDevice = next;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (current == "--sysroot") {
|
||||
if (next.isNull())
|
||||
return false;
|
||||
@@ -721,6 +731,10 @@ QVariantMap AddKitData::addKit(const QVariantMap &map, const QVariantMap &tcMap,
|
||||
std::cerr << "Error: Device " << qPrintable(m_device) << " does not exist." << std::endl;
|
||||
return QVariantMap();
|
||||
}
|
||||
if (!m_buildDevice.isEmpty() && !AddDeviceOperation::exists(devMap, m_buildDevice)) {
|
||||
std::cerr << "Error: Device " << qPrintable(m_buildDevice) << " does not exist." << std::endl;
|
||||
return QVariantMap();
|
||||
}
|
||||
|
||||
// Treat a qt that was explicitly set to '' as "no Qt"
|
||||
if (!qtId.isNull() && qtId.isEmpty())
|
||||
@@ -767,6 +781,8 @@ QVariantMap AddKitData::addKit(const QVariantMap &map, const QVariantMap &tcMap,
|
||||
data << KeyValuePair({kit, DATA, DEVICE_TYPE}, QVariant(m_deviceType));
|
||||
if (!m_device.isNull())
|
||||
data << KeyValuePair({kit, DATA, DEVICE_ID}, QVariant(m_device));
|
||||
if (!m_buildDevice.isNull())
|
||||
data << KeyValuePair({kit, DATA, BUILDDEVICE_ID}, QVariant(m_buildDevice));
|
||||
if (!m_sysRoot.isNull())
|
||||
data << KeyValuePair({kit, DATA, SYSROOT}, Utils::FilePath::fromUserInput(m_sysRoot).toVariant());
|
||||
for (auto i = m_tcs.constBegin(); i != m_tcs.constEnd(); ++i)
|
||||
|
@@ -47,6 +47,7 @@ public:
|
||||
QString m_debugger;
|
||||
QString m_deviceType;
|
||||
QString m_device;
|
||||
QString m_buildDevice;
|
||||
QString m_sysRoot;
|
||||
QHash<QString, QString> m_tcs;
|
||||
QString m_qt;
|
||||
|
Reference in New Issue
Block a user