summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2012-02-27 10:21:10 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-21 08:37:40 (GMT)
commit248918b03fcbe6e20d1f8e757e3430bbf0f20d47 (patch)
treeac85380e0dbc2139c15e15b120c3f632223fb0e4
parentcf179ef3e38516555ce60517aa8e085b33e75744 (diff)
downloadQt-248918b03fcbe6e20d1f8e757e3430bbf0f20d47.zip
Qt-248918b03fcbe6e20d1f8e757e3430bbf0f20d47.tar.gz
Qt-248918b03fcbe6e20d1f8e757e3430bbf0f20d47.tar.bz2
Make configure.exe only detect each compiler once
When reading the registry on a 64 bit Windows, the same compiler can be detected twice, breaking the -platform detection even when only one compiler is in the path. Fix this by taking advantage of the CompilerInfo struct ordering and ignore detection of the same compiler. Change-Id: I583230520d2e0859196f9d7c8af31adbb981a6ca Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> (cherry picked from commit fa5cf01e7468e53508b15726625fd681892119a4) Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
-rw-r--r--tools/configure/environment.cpp38
1 files changed, 29 insertions, 9 deletions
diff --git a/tools/configure/environment.cpp b/tools/configure/environment.cpp
index 72d9e5c..34aa78c 100644
--- a/tools/configure/environment.cpp
+++ b/tools/configure/environment.cpp
@@ -167,8 +167,18 @@ Compiler Environment::detectCompiler()
QStringList::iterator it;
for(it = pathlist.begin(); it != pathlist.end(); ++it) {
if((*it).contains(productPath)) {
- ++installed;
- detectedCompiler = compiler_info[i].compiler;
+ if (detectedCompiler != compiler_info[i].compiler) {
+ ++installed;
+ detectedCompiler = compiler_info[i].compiler;
+ }
+ /* else {
+
+ We detected the same compiler again, which happens when
+ configure is run on a 64 bit Windows. Skip the
+ duplicate so that we don't think it's installed twice.
+
+ }
+ */
break;
}
}
@@ -180,14 +190,24 @@ Compiler Environment::detectCompiler()
for(int i = 0; compiler_info[i].compiler; ++i) {
QString executable = QString(compiler_info[i].executable).toLower();
if (executable.length() && Environment::detectExecutable(executable)) {
- ++installed;
- detectedCompiler = compiler_info[i].compiler;
- if (detectedCompiler == CC_MINGW) {
- bool is64bit;
- const int version = detectGPlusPlusVersion(executable, &is64bit);
- if (version < 0x040600)
- detectedCompiler = CC_MINGW_44;
+ if (detectedCompiler != compiler_info[i].compiler) {
+ ++installed;
+ detectedCompiler = compiler_info[i].compiler;
+ if (detectedCompiler == CC_MINGW) {
+ bool is64bit;
+ const int version = detectGPlusPlusVersion(executable, &is64bit);
+ if (version < 0x040600)
+ detectedCompiler = CC_MINGW_44;
+ }
+ }
+ /* else {
+
+ We detected the same compiler again, which happens when
+ configure is run on a 64 bit Windows. Skip the
+ duplicate so that we don't think it's installed twice.
+
}
+ */
break;
}
}