remove some cryptic code relating to output directories

the purpose of it is truly elusive - the output directory is maintained
by the surrounding code anyway.

Change-Id: Id1a481d85a7b83ab0676ef650c900414d0ba83b3
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
This commit is contained in:
Oswald Buddenhagen 2013-02-25 19:54:48 +01:00 committed by The Qt Project
parent 083c8ce840
commit 3f5633bc25
3 changed files with 8 additions and 12 deletions

View File

@ -79,7 +79,7 @@ public:
virtual bool init(); virtual bool init();
virtual int type() const { return BUILDSMETATYPE; } virtual int type() const { return BUILDSMETATYPE; }
virtual bool write(const QString &); virtual bool write();
}; };
void void
@ -149,7 +149,7 @@ BuildsMetaMakefileGenerator::init()
} }
bool bool
BuildsMetaMakefileGenerator::write(const QString &oldpwd) BuildsMetaMakefileGenerator::write()
{ {
Build *glue = 0; Build *glue = 0;
if(!makefiles.isEmpty() && !makefiles.first()->build.isNull()) { if(!makefiles.isEmpty() && !makefiles.first()->build.isNull()) {
@ -181,7 +181,6 @@ BuildsMetaMakefileGenerator::write(const QString &oldpwd)
if(Option::output.fileName().isEmpty() && if(Option::output.fileName().isEmpty() &&
Option::qmake_mode == Option::QMAKE_GENERATE_MAKEFILE) Option::qmake_mode == Option::QMAKE_GENERATE_MAKEFILE)
Option::output.setFileName(project->first("QMAKE_MAKEFILE").toQString()); Option::output.setFileName(project->first("QMAKE_MAKEFILE").toQString());
Option::output_dir = oldpwd;
QString build_name = build->name; QString build_name = build->name;
if(!build->build.isEmpty()) { if(!build->build.isEmpty()) {
if(!build_name.isEmpty()) if(!build_name.isEmpty())
@ -268,7 +267,7 @@ public:
virtual bool init(); virtual bool init();
virtual int type() const { return SUBDIRSMETATYPE; } virtual int type() const { return SUBDIRSMETATYPE; }
virtual bool write(const QString &); virtual bool write();
}; };
bool bool
@ -349,7 +348,7 @@ SubdirsMetaMakefileGenerator::init()
} else { } else {
const QString output_name = Option::output.fileName(); const QString output_name = Option::output.fileName();
Option::output.setFileName(sub->output_file); Option::output.setFileName(sub->output_file);
hasError |= !sub->makefile->write(sub->output_dir); hasError |= !sub->makefile->write();
delete sub; delete sub;
qmakeClearCaches(); qmakeClearCaches();
sub = 0; sub = 0;
@ -378,7 +377,7 @@ SubdirsMetaMakefileGenerator::init()
} }
bool bool
SubdirsMetaMakefileGenerator::write(const QString &oldpwd) SubdirsMetaMakefileGenerator::write()
{ {
bool ret = true; bool ret = true;
const QString &pwd = qmake_getpwd(); const QString &pwd = qmake_getpwd();
@ -397,10 +396,7 @@ SubdirsMetaMakefileGenerator::write(const QString &oldpwd)
printf("Writing %s\n", QDir::cleanPath(Option::output_dir+"/"+ printf("Writing %s\n", QDir::cleanPath(Option::output_dir+"/"+
Option::output.fileName()).toLatin1().constData()); Option::output.fileName()).toLatin1().constData());
} }
QString writepwd = Option::fixPathToLocalOS(qmake_getpwd()); if (!(ret = subs.at(i)->makefile->write()))
if(!writepwd.startsWith(Option::fixPathToLocalOS(oldpwd)))
writepwd = oldpwd;
if(!(ret = subs.at(i)->makefile->write(writepwd)))
break; break;
//restore because I'm paranoid //restore because I'm paranoid
qmake_setpwd(pwd); qmake_setpwd(pwd);

View File

@ -69,7 +69,7 @@ public:
virtual bool init() = 0; virtual bool init() = 0;
virtual int type() const { return -1; } virtual int type() const { return -1; }
virtual bool write(const QString &oldpwd) = 0; virtual bool write() = 0;
}; };
QT_END_NAMESPACE QT_END_NAMESPACE

View File

@ -187,7 +187,7 @@ int runQMake(int argc, char **argv)
if (!success) if (!success)
exit_val = 3; exit_val = 3;
if(mkfile && !mkfile->write(oldpwd)) { if (mkfile && !mkfile->write()) {
if(Option::qmake_mode == Option::QMAKE_GENERATE_PROJECT) if(Option::qmake_mode == Option::QMAKE_GENERATE_PROJECT)
fprintf(stderr, "Unable to generate project file.\n"); fprintf(stderr, "Unable to generate project file.\n");
else else