summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2010-02-22 18:06:07 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2010-02-26 13:31:06 (GMT)
commita5075f3d48d2961b8314b8aaeb02de092e2fa796 (patch)
tree0187246cd4596e458855bbd887233db621eb439a /qmake
parent54775a43b512eac1171e64dbecbb85f8d57748bc (diff)
downloadQt-a5075f3d48d2961b8314b8aaeb02de092e2fa796.zip
Qt-a5075f3d48d2961b8314b8aaeb02de092e2fa796.tar.gz
Qt-a5075f3d48d2961b8314b8aaeb02de092e2fa796.tar.bz2
give symbian an own platform mode
... instead of using the gross isForSymbian() magic Reviewed-by: mariusSO
Diffstat (limited to 'qmake')
-rw-r--r--qmake/generators/makefile.h1
-rw-r--r--qmake/generators/metamakefile.cpp2
-rw-r--r--qmake/generators/symbian/symmake_sbsv2.h1
-rw-r--r--qmake/option.h3
-rw-r--r--qmake/project.cpp99
-rw-r--r--qmake/project.h4
6 files changed, 19 insertions, 91 deletions
diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h
index 1f70e64..addb1f5 100644
--- a/qmake/generators/makefile.h
+++ b/qmake/generators/makefile.h
@@ -248,6 +248,7 @@ public:
virtual bool mergeBuildProject(MakefileGenerator * /*other*/) { return false; }
virtual bool openOutput(QFile &, const QString &build) const;
virtual bool isWindowsShell() const { return Option::host_mode == Option::HOST_WIN_MODE; }
+ virtual bool isForSymbianSbsv2() const { return false; } // FIXME: killme - i'm ugly!
};
inline void MakefileGenerator::setNoIO(bool o)
diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp
index e764dd3..bc8927c 100644
--- a/qmake/generators/metamakefile.cpp
+++ b/qmake/generators/metamakefile.cpp
@@ -512,7 +512,7 @@ MetaMakefileGenerator::modesForGenerator(const QString &gen,
#else
*host_mode = Option::HOST_WIN_MODE;
#endif
- *target_mode = Option::TARG_WIN_MODE; // anything, just not unknown
+ *target_mode = Option::TARG_SYMBIAN_MODE;
} else {
fprintf(stderr, "Unknown generator specified: %s\n", gen.toLatin1().constData());
return false;
diff --git a/qmake/generators/symbian/symmake_sbsv2.h b/qmake/generators/symbian/symmake_sbsv2.h
index 5c31249..4e88465 100644
--- a/qmake/generators/symbian/symmake_sbsv2.h
+++ b/qmake/generators/symbian/symmake_sbsv2.h
@@ -56,6 +56,7 @@ protected:
virtual void writeMkFile(const QString& wrapperFileName, bool deploymentOnly);
virtual void writeWrapperMakefile(QFile& wrapperFile, bool isPrimaryMakefile);
virtual void appendAbldTempDirs(QStringList& sysincspaths, QString includepath);
+ virtual bool isForSymbianSbsv2() const { return true; } // FIXME: killme - i'm ugly!
public:
diff --git a/qmake/option.h b/qmake/option.h
index 953d91e..92689f2 100644
--- a/qmake/option.h
+++ b/qmake/option.h
@@ -154,7 +154,8 @@ struct Option
static QStringList before_user_vars, after_user_vars, user_configs, after_user_configs;
enum HOST_MODE { HOST_UNKNOWN_MODE, HOST_UNIX_MODE, HOST_WIN_MODE, HOST_MACX_MODE };
static HOST_MODE host_mode;
- enum TARG_MODE { TARG_UNKNOWN_MODE, TARG_UNIX_MODE, TARG_WIN_MODE, TARG_MACX_MODE };
+ enum TARG_MODE { TARG_UNKNOWN_MODE, TARG_UNIX_MODE, TARG_WIN_MODE, TARG_MACX_MODE,
+ TARG_SYMBIAN_MODE };
static TARG_MODE target_mode;
static bool target_mode_overridden;
static QString user_template, user_template_prefix;
diff --git a/qmake/project.cpp b/qmake/project.cpp
index d2fdf02..951ca33 100644
--- a/qmake/project.cpp
+++ b/qmake/project.cpp
@@ -509,65 +509,6 @@ static void qmake_error_msg(const QString &msg)
msg.toLatin1().constData());
}
-enum isForSymbian_enum {
- isForSymbian_NOT_SET = -1,
- isForSymbian_FALSE = 0,
- isForSymbian_ABLD = 1,
- isForSymbian_SBSV2 = 2,
-};
-
-static isForSymbian_enum isForSymbian_value = isForSymbian_NOT_SET;
-
-// Checking for symbian build is primarily determined from the qmake spec,
-// but if that is not specified, detect if symbian is the default spec
-// by checking the MAKEFILE_GENERATOR variable value.
-static void init_symbian(const QMap<QString, QStringList>& vars)
-{
- if (isForSymbian_value != isForSymbian_NOT_SET)
- return;
-
- QString spec = QFileInfo(Option::mkfile::qmakespec).fileName();
- if (spec.startsWith("symbian-abld", Qt::CaseInsensitive)) {
- isForSymbian_value = isForSymbian_ABLD;
- } else if (spec.startsWith("symbian-sbsv2", Qt::CaseInsensitive)) {
- isForSymbian_value = isForSymbian_SBSV2;
- } else {
- QStringList generatorList = vars["MAKEFILE_GENERATOR"];
-
- if (!generatorList.isEmpty()) {
- QString generator = generatorList.first();
- if (generator.startsWith("SYMBIAN_ABLD"))
- isForSymbian_value = isForSymbian_ABLD;
- else if (generator.startsWith("SYMBIAN_SBSV2"))
- isForSymbian_value = isForSymbian_SBSV2;
- else
- isForSymbian_value = isForSymbian_FALSE;
- } else {
- isForSymbian_value = isForSymbian_FALSE;
- }
- }
-}
-
-bool isForSymbian()
-{
- // If isForSymbian_value has not been initialized explicitly yet,
- // call initializer with dummy map to check qmake spec.
- if (isForSymbian_value == isForSymbian_NOT_SET)
- init_symbian(QMap<QString, QStringList>());
-
- return (isForSymbian_value != isForSymbian_FALSE);
-}
-
-bool isForSymbianSbsv2()
-{
- // If isForSymbian_value has not been initialized explicitly yet,
- // call initializer with dummy map to check qmake spec.
- if (isForSymbian_value == isForSymbian_NOT_SET)
- init_symbian(QMap<QString, QStringList>());
-
- return (isForSymbian_value == isForSymbian_SBSV2);
-}
-
/*
1) environment variable QMAKEFEATURES (as separated by colons)
2) property variable QMAKEFEATURES (as separated by colons)
@@ -595,21 +536,14 @@ QStringList qmake_feature_paths(QMakeProperty *prop=0)
break;
default: // Can't happen, just make the compiler shut up
case Option::TARG_UNIX_MODE:
- {
- if (isForSymbian())
- concat << base_concat + QDir::separator() + "symbian";
- else
- concat << base_concat + QDir::separator() + "unix";
- break;
- }
+ concat << base_concat + QDir::separator() + "unix";
+ break;
case Option::TARG_WIN_MODE:
- {
- if (isForSymbian())
- concat << base_concat + QDir::separator() + "symbian";
- else
- concat << base_concat + QDir::separator() + "win32";
- break;
- }
+ concat << base_concat + QDir::separator() + "win32";
+ break;
+ case Option::TARG_SYMBIAN_MODE:
+ concat << base_concat + QDir::separator() + "symbian";
+ break;
}
concat << base_concat;
}
@@ -1449,8 +1383,6 @@ QMakeProject::read(uchar cmd)
}
validateModes();
- init_symbian(base_vars);
-
if(Option::mkfile::do_cache && !Option::mkfile::cachefile.isEmpty()) {
debug_msg(1, "QMAKECACHE file: reading %s", Option::mkfile::cachefile.toLatin1().constData());
read(Option::mkfile::cachefile, base_vars);
@@ -1598,6 +1530,8 @@ void QMakeProject::validateModes()
Option::target_mode = Option::TARG_UNIX_MODE;
else if (os == "macx")
Option::target_mode = Option::TARG_MACX_MODE;
+ else if (os == "symbian")
+ Option::target_mode = Option::TARG_SYMBIAN_MODE;
else if (os == "win32")
Option::target_mode = Option::TARG_WIN_MODE;
else
@@ -1623,24 +1557,20 @@ QMakeProject::isActiveConfig(const QString &x, bool regex, QMap<QString, QString
else if(x == "false")
return false;
- // 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 (x == "unix") {
validateModes();
return Option::target_mode == Option::TARG_UNIX_MODE
|| Option::target_mode == Option::TARG_MACX_MODE
- || isForSymbian();
+ || Option::target_mode == Option::TARG_SYMBIAN_MODE;
} else if (x == "macx" || x == "mac") {
validateModes();
- return Option::target_mode == Option::TARG_MACX_MODE && !isForSymbian();
+ return Option::target_mode == Option::TARG_MACX_MODE;
} else if (x == "symbian") {
- return isForSymbian();
+ validateModes();
+ return Option::target_mode == Option::TARG_SYMBIAN_MODE;
} else if (x == "win32") {
validateModes();
- return Option::target_mode == Option::TARG_WIN_MODE && !isForSymbian();
+ return Option::target_mode == Option::TARG_WIN_MODE;
}
//mkspecs
@@ -1739,7 +1669,6 @@ QMakeProject::doProjectInclude(QString file, uchar flags, QMap<QString, QStringL
static QStringList *feature_roots = 0;
if(!feature_roots) {
validateModes();
- init_symbian(base_vars);
feature_roots = new QStringList(qmake_feature_paths(prop));
qmakeAddCacheClear(qmakeDeleteCacheClear_QStringList, (void**)&feature_roots);
}
diff --git a/qmake/project.h b/qmake/project.h
index 50706cb..bfebed0 100644
--- a/qmake/project.h
+++ b/qmake/project.h
@@ -196,10 +196,6 @@ inline QString QMakeProject::first(const QString &v)
inline QMap<QString, QStringList> &QMakeProject::variables()
{ return vars; }
-// Helper functions needed for Symbian
-bool isForSymbian();
-bool isForSymbianSbsv2();
-
QT_END_NAMESPACE
#endif // PROJECT_H