diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2009-12-10 17:53:25 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2010-02-26 13:29:15 (GMT) |
commit | eef98705e295bcebc4dc392536e43141d8c24a6d (patch) | |
tree | c90ed47a2bf1782abf1636b65027d2648e579fc8 /qmake | |
parent | e1496ecc0a8e4f753edf22ed39c2179cb0f0f3d8 (diff) | |
download | Qt-eef98705e295bcebc4dc392536e43141d8c24a6d.zip Qt-eef98705e295bcebc4dc392536e43141d8c24a6d.tar.gz Qt-eef98705e295bcebc4dc392536e43141d8c24a6d.tar.bz2 |
sanitize evaluation of OS scopes
this is marginally behavior-incompatible in that adding the name of an
OS scope to CONFIG will not make it true any longer.
the cleaned up semantics (besides having merit by themselves) will
enable optimizations.
Reviewed-by: mariusSO
Diffstat (limited to 'qmake')
-rw-r--r-- | qmake/project.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/qmake/project.cpp b/qmake/project.cpp index 274e54a..ba0db66 100644 --- a/qmake/project.cpp +++ b/qmake/project.cpp @@ -1591,26 +1591,27 @@ QMakeProject::isActiveConfig(const QString &x, bool regex, QMap<QString, QString else if(x == "false") return false; - static QString spec; - if(spec.isEmpty()) - spec = QFileInfo(Option::mkfile::qmakespec).fileName(); - // Symbian is an exception to how scopes are resolved. Since we do not // have a separate target mode for Symbian, but we expect the scope to resolve // on other platforms we base it entirely on the mkspec. This means that // using a mkspec starting with 'symbian*' will resolve both the 'symbian' // and the 'unix' (because of Open C) scopes to true. - if(isForSymbian() && (x == "symbian" || x == "unix")) - return true; + if (x == "unix") { + return Option::target_mode == Option::TARG_UNIX_MODE + || Option::target_mode == Option::TARG_MACX_MODE + || isForSymbian(); + } else if (x == "macx" || x == "mac") { + return Option::target_mode == Option::TARG_MACX_MODE && !isForSymbian(); + } else if (x == "symbian") { + return isForSymbian(); + } else if (x == "win32") { + return Option::target_mode == Option::TARG_WIN_MODE && !isForSymbian(); + } //mkspecs - if((Option::target_mode == Option::TARG_MACX_MODE || - Option::target_mode == Option::TARG_UNIX_MODE) && x == "unix") - return !isForSymbian(); - else if(Option::target_mode == Option::TARG_MACX_MODE && (x == "macx" || x == "mac")) - return !isForSymbian(); - else if(Option::target_mode == Option::TARG_WIN_MODE && x == "win32") - return !isForSymbian(); + static QString spec; + if(spec.isEmpty()) + spec = QFileInfo(Option::mkfile::qmakespec).fileName(); QRegExp re(x, Qt::CaseSensitive, QRegExp::Wildcard); if((regex && re.exactMatch(spec)) || (!regex && spec == x)) return true; |