diff options
author | Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com> | 2012-03-20 21:01:20 -0700 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-22 20:59:27 +0100 |
commit | 4cc9523a3153a0e7b012de3919e0c4f4ccb96265 (patch) | |
tree | c4d5733084b4c51340c9491f186501035d3ec4ed /tools/configure | |
parent | 31f9df520527be3f7a0f45092dbb5bc9ed1700ff (diff) |
Make architecture detection more robust.
Any message/error in mkspecs or qmake feature files ends up confusing
the current arch detection logic. Instead, search for
"Project MESSAGE: .* Architecture: <arch>".
Change-Id: I308932a5b75f3a1fcbc4fe30c74faf2e83b2d752
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'tools/configure')
-rw-r--r-- | tools/configure/configureapp.cpp | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 0c9907f6d5..58ffd28ff3 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -2584,32 +2584,9 @@ void Configure::detectArch() if (output.isEmpty()) continue; - // strip everything up to and including 'Project MESSAGE: ' - QString ProjectMESSAGE = QStringLiteral("Project MESSAGE: "); - int at = output.indexOf(ProjectMESSAGE); - if (at != -1) - output = output.mid(at + ProjectMESSAGE.length()); - - // strip lines beginning with a # - at = 0; - while ((at = output.indexOf('#', at)) != -1) { - if (at > 0 && output.at(at - 1) != '\n') { - // # isnt' at the beginning of a line, skip it - ++at; - continue; - } - - int eol = output.indexOf('\n', at); - if (eol == -1) { - // end of string - output.remove(at, output.length() - at); - break; - } - - output.remove(at, eol - at + 1); - } - - dictionary[key] = output.simplified(); + QRegExp re("Project MESSAGE:.*Architecture: ([a-zA-Z0-9]*)"); + if (re.indexIn(output) != -1) + dictionary[key] = re.cap(1); } if (!dictionary.contains("QT_HOST_ARCH")) |