summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qmake/generators/metamakefile.cpp14
-rw-r--r--qmake/generators/metamakefile.h2
-rw-r--r--qmake/main.cpp5
3 files changed, 13 insertions, 8 deletions
diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp
index 69dd627..3acb2dd 100644
--- a/qmake/generators/metamakefile.cpp
+++ b/qmake/generators/metamakefile.cpp
@@ -291,7 +291,7 @@ SubdirsMetaMakefileGenerator::init()
if(init_flag)
return false;
init_flag = true;
-
+ bool hasError = false;
if(Option::recursive) {
QString old_output_dir = Option::output_dir;
QString old_output = Option::output.fileName();
@@ -336,7 +336,7 @@ SubdirsMetaMakefileGenerator::init()
}
qmake_setpwd(sub->input_dir);
Option::output_dir = sub->output_dir;
- sub_proj->read(subdir.fileName());
+ hasError |= !sub_proj->read(subdir.fileName());
if(!sub_proj->variables()["QMAKE_FAILED_REQUIREMENTS"].isEmpty()) {
fprintf(stderr, "Project file(%s) not recursed because all requirements not met:\n\t%s\n",
subdir.fileName().toLatin1().constData(),
@@ -351,7 +351,7 @@ SubdirsMetaMakefileGenerator::init()
} else {
const QString output_name = Option::output.fileName();
Option::output.setFileName(sub->output_file);
- sub->makefile->write(sub->output_dir);
+ hasError |= !sub->makefile->write(sub->output_dir);
delete sub;
qmakeClearCaches();
sub = 0;
@@ -376,7 +376,7 @@ SubdirsMetaMakefileGenerator::init()
self->makefile->init();
subs.append(self);
- return true;
+ return !hasError;
}
bool
@@ -745,7 +745,7 @@ MetaMakefileGenerator::createMakefileGenerator(QMakeProject *proj, bool noIO)
}
MetaMakefileGenerator *
-MetaMakefileGenerator::createMetaGenerator(QMakeProject *proj, const QString &name, bool op)
+MetaMakefileGenerator::createMetaGenerator(QMakeProject *proj, const QString &name, bool op, bool *success)
{
MetaMakefileGenerator *ret = 0;
if ((Option::qmake_mode == Option::QMAKE_GENERATE_MAKEFILE ||
@@ -758,7 +758,9 @@ MetaMakefileGenerator::createMetaGenerator(QMakeProject *proj, const QString &na
}
if (!ret)
ret = new BuildsMetaMakefileGenerator(proj, name, op);
- ret->init();
+ bool res = ret->init();
+ if (success)
+ *success = res;
return ret;
}
diff --git a/qmake/generators/metamakefile.h b/qmake/generators/metamakefile.h
index e69304a..f74f4a2 100644
--- a/qmake/generators/metamakefile.h
+++ b/qmake/generators/metamakefile.h
@@ -62,7 +62,7 @@ public:
virtual ~MetaMakefileGenerator();
- static MetaMakefileGenerator *createMetaGenerator(QMakeProject *proj, const QString &name, bool op=true);
+ static MetaMakefileGenerator *createMetaGenerator(QMakeProject *proj, const QString &name, bool op=true, bool *success = 0);
static MakefileGenerator *createMakefileGenerator(QMakeProject *proj, bool noIO = false);
inline QMakeProject *projectFile() const { return project; }
diff --git a/qmake/main.cpp b/qmake/main.cpp
index 73fdda9..8117a4c 100644
--- a/qmake/main.cpp
+++ b/qmake/main.cpp
@@ -168,7 +168,10 @@ int runQMake(int argc, char **argv)
continue;
}
- MetaMakefileGenerator *mkfile = MetaMakefileGenerator::createMetaGenerator(&project, QString(), false);
+ bool success = true;
+ MetaMakefileGenerator *mkfile = MetaMakefileGenerator::createMetaGenerator(&project, QString(), false, &success);
+ if (!success)
+ exit_val = 3;
if(mkfile && !mkfile->write(oldpwd)) {
if(Option::qmake_mode == Option::QMAKE_GENERATE_PROJECT)
fprintf(stderr, "Unable to generate project file.\n");