diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2012-04-16 17:12:53 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2012-06-27 09:39:50 +0200 |
commit | 0ce1a6ba244c934b5b4504abb980806793d54515 (patch) | |
tree | 6d361c443dab353a2af8995baf0d1b8caa879b08 /qmake/project.cpp | |
parent | fc1bca86081dc0698a7dd3f9c955edd194d5a798 (diff) |
don't let the make spec determine the host mode any more
(some of) the generators are (moderately) x-platform, so it makes no
sense to nail the host platform to a generator (and thus a spec).
overriding the host platform is only a debugging mesasure anyway, so one
can use the (now undocumented) -unix/-macx/-win32 options for that.
Change-Id: If2a059f1feeb2c726e5838625ede1c7add829985
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
Diffstat (limited to 'qmake/project.cpp')
-rw-r--r-- | qmake/project.cpp | 44 |
1 files changed, 16 insertions, 28 deletions
diff --git a/qmake/project.cpp b/qmake/project.cpp index 360c0958f1..1eb41ecfda 100644 --- a/qmake/project.cpp +++ b/qmake/project.cpp @@ -1600,37 +1600,27 @@ QMakeProject::read(uchar cmd) void QMakeProject::validateModes() { - if (Option::host_mode == Option::HOST_UNKNOWN_MODE - || Option::target_mode == Option::TARG_UNKNOWN_MODE) { - Option::HOST_MODE host_mode; + if (Option::target_mode == Option::TARG_UNKNOWN_MODE) { Option::TARG_MODE target_mode; const QStringList &gen = base_vars.value("MAKEFILE_GENERATOR"); if (gen.isEmpty()) { fprintf(stderr, "%s:%d: Using OS scope before setting MAKEFILE_GENERATOR\n", parser.file.toLatin1().constData(), parser.line_no); - } else if (MetaMakefileGenerator::modesForGenerator(gen.first(), - &host_mode, &target_mode)) { - if (Option::host_mode == Option::HOST_UNKNOWN_MODE) { - Option::host_mode = host_mode; - Option::applyHostMode(); - } - - if (Option::target_mode == Option::TARG_UNKNOWN_MODE) { - const QStringList &tgt = base_vars.value("TARGET_PLATFORM"); - if (!tgt.isEmpty()) { - const QString &os = tgt.first(); - if (os == "unix") - Option::target_mode = Option::TARG_UNIX_MODE; - else if (os == "macx") - Option::target_mode = Option::TARG_MACX_MODE; - else if (os == "win32") - Option::target_mode = Option::TARG_WIN_MODE; - else - fprintf(stderr, "Unknown target platform specified: %s\n", - os.toLatin1().constData()); - } else { - Option::target_mode = target_mode; - } + } else if (MetaMakefileGenerator::modeForGenerator(gen.first(), &target_mode)) { + const QStringList &tgt = base_vars.value("TARGET_PLATFORM"); + if (!tgt.isEmpty()) { + const QString &os = tgt.first(); + if (os == "unix") + Option::target_mode = Option::TARG_UNIX_MODE; + else if (os == "macx") + Option::target_mode = Option::TARG_MACX_MODE; + else if (os == "win32") + Option::target_mode = Option::TARG_WIN_MODE; + else + fprintf(stderr, "Unknown target platform specified: %s\n", + os.toLatin1().constData()); + } else { + Option::target_mode = target_mode; } } } @@ -1752,7 +1742,6 @@ QMakeProject::doProjectInclude(QString file, uchar flags, QHash<QString, QString if(flags & IncludeFlagFeature) { if(!file.endsWith(Option::prf_ext)) file += Option::prf_ext; - validateModes(); // init dir_sep if(file.indexOf(QLatin1Char('/')) == -1 || !QFile::exists(file)) { QStringList *&feature_roots = all_feature_roots[host_build]; if(!feature_roots) { @@ -3737,7 +3726,6 @@ QStringList &QMakeProject::values(const QString &_var, QHash<QString, QStringLis var = ".BUILTIN." + var; place[var] = QStringList(qmake_getpwd()); } else if(var == QLatin1String("DIR_SEPARATOR")) { - validateModes(); var = ".BUILTIN." + var; place[var] = QStringList(Option::dir_sep); } else if(var == QLatin1String("DIRLIST_SEPARATOR")) { |