diff --git a/src/tools/sdktool/addkitoperation.cpp b/src/tools/sdktool/addkitoperation.cpp index 0a2e964aad2..18ecc4965b2 100644 --- a/src/tools/sdktool/addkitoperation.cpp +++ b/src/tools/sdktool/addkitoperation.cpp @@ -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 debuggerengine of the new kit.\n" " --debugger debugger of the new kit.\n" - " --devicetype device type of the new kit (required).\n" - " --device device id to use (optional).\n" + " --devicetype (run-)device type of the new kit (required).\n" + " --device (run-)device id to use (optional).\n" + " --builddevice build device id to use (optional).\n" " --sysroot sysroot of the new kit.\n" " --toolchain tool chain of the new kit (obsolete!).\n" " --toolchain 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) diff --git a/src/tools/sdktool/addkitoperation.h b/src/tools/sdktool/addkitoperation.h index 89b588e7944..3d3f3b8f5fd 100644 --- a/src/tools/sdktool/addkitoperation.h +++ b/src/tools/sdktool/addkitoperation.h @@ -47,6 +47,7 @@ public: QString m_debugger; QString m_deviceType; QString m_device; + QString m_buildDevice; QString m_sysRoot; QHash m_tcs; QString m_qt;