aboutsummaryrefslogtreecommitdiffstats
path: root/src/tools/sdktool/addkitoperation.cpp
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@qt.io>2016-07-22 10:55:43 +0200
committerTobias Hunger <tobias.hunger@qt.io>2016-07-22 12:38:43 +0000
commita1852505294a5d6c53abdb7770119b6e51c576ab (patch)
tree10457dc53d420e651c19211fbcf5d4a28633d91a /src/tools/sdktool/addkitoperation.cpp
parent1b34f2a4b8bc0b1f883a96c59eeb10fd34dee2bd (diff)
SDKtool: Keep old syntax for toolchain registration working
Keep the old syntax for registering toolchains for new kits via the SDK tool working. This should make for smoother sailing for our users, as we can not foretell which combinations of Qt Creator and Qt installer (with SDKtool calls) will end up on the machines of our users. Change-Id: Ib0fb99759ab9dcd75c64c556e18c27e900bf6236 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Diffstat (limited to 'src/tools/sdktool/addkitoperation.cpp')
-rw-r--r--src/tools/sdktool/addkitoperation.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/tools/sdktool/addkitoperation.cpp b/src/tools/sdktool/addkitoperation.cpp
index af205aaf3d..b2ebc9f80c 100644
--- a/src/tools/sdktool/addkitoperation.cpp
+++ b/src/tools/sdktool/addkitoperation.cpp
@@ -95,7 +95,8 @@ QString AddKitOperation::argumentsHelpText() const
" --devicetype <TYPE> device type of the new kit (required).\n"
" --device <ID> device id to use (optional).\n"
" --sysroot <PATH> sysroot of the new kit.\n"
- " --toolchain <LANGID> <ID> tool chain of the new kit (may repeat!).\n"
+ " --toolchain <ID> tool chain of the new kit (obsolete!).\n"
+ " --<LANG>toolchain <ID> tool chain for a language.\n"
" --qt <ID> Qt of the new kit.\n"
" --mkspec <PATH> mkspec of the new kit.\n"
" --env <VALUE> add a custom environment setting. [may be repeated]\n"
@@ -109,7 +110,6 @@ bool AddKitOperation::setArguments(const QStringList &args)
for (int i = 0; i < args.count(); ++i) {
const QString current = args.at(i);
const QString next = ((i + 1) < args.count()) ? args.at(i + 1) : QString();
- const QString nextnext = ((i + 2) < args.count()) ? args.at(i + 2) : QString();
if (current == "--id") {
if (next.isNull())
@@ -188,24 +188,24 @@ bool AddKitOperation::setArguments(const QStringList &args)
continue;
}
- if (current == "--toolchain") {
+ if (current.startsWith("--") && current.endsWith("toolchain")) {
if (next.isNull())
return false;
++i; // skip next;
+ const QString tmp = current.mid(2);
+ const QString tmp2 = tmp.mid(0, tmp.count() - 9 /* toolchain */);
+ const QString lang = tmp2.isEmpty() ? QString("Cxx") : tmp2;
+
if (next.isEmpty()) {
std::cerr << "Empty langid for toolchain given." << std::endl << std::endl;
return false;
}
- if (nextnext.isEmpty()) {
- std::cerr << "Empty id for toolchain given." << std::endl << std::endl;
- return false;
- }
- if (m_tcs.contains(next)) {
+ if (m_tcs.contains(lang)) {
std::cerr << "No langid for toolchain given twice." << std::endl << std::endl;
return false;
}
- m_tcs.insert(next, nextnext);
+ m_tcs.insert(lang, next);
continue;
}