From 0ce1a6ba244c934b5b4504abb980806793d54515 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 16 Apr 2012 17:12:53 +0200 Subject: 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 Reviewed-by: Mark Brand --- qmake/project.cpp | 44 ++++++++++++++++---------------------------- 1 file changed, 16 insertions(+), 28 deletions(-) (limited to 'qmake/project.cpp') 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