Skip to content

Commit

Permalink
Verifying MingGW build works without any changes...
Browse files Browse the repository at this point in the history
Signed-off-by: John Bowler <[email protected]>
  • Loading branch information
jbowler committed Oct 15, 2023
1 parent 2b34c60 commit 86a27b5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions generator/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
**
****************************************************************************/

#include <cstdio>

#include "main.h"
#include "asttoxml.h"
#include "reporthandler.h"
Expand All @@ -53,6 +55,13 @@ void displayHelp(GeneratorSet *generatorSet);
#include <QDebug>
int main(int argc, char *argv[])
{
/* Ensure printf function calls are always line buffered to avoid curious
* interleaving of the stdout and stderr streams when the output is piped
* to a file. Ignore errors here (i.e. ignore closed stdout).
*/
(void)setvbuf(stdout, nullptr, _IOLBF, 0);
ReportHandler::setContext("Arguments");

QScopedPointer<GeneratorSet> gs(GeneratorSet::getInstance());

QString default_file = ":/trolltech/generator/qtscript_masterinclude.h";
Expand Down Expand Up @@ -135,11 +144,13 @@ int main(int argc, char *argv[])
printf("Please wait while source files are being generated...\n");

printf("Parsing typesystem file [%s]\n", qPrintable(typesystemFileName));
ReportHandler::setContext("Typesytem");
if (!TypeDatabase::instance()->parseFile(typesystemFileName))
qFatal("Cannot parse file: '%s'", qPrintable(typesystemFileName));

printf("PreProcessing - Generate [%s] using [%s] and include-paths [%s]\n",
qPrintable(pp_file), qPrintable(fileName), qPrintable(args.value("include-paths")));
ReportHandler::setContext("Preprocess");
if (!Preprocess::preprocess(fileName, pp_file, args.value("include-paths"))) {
fprintf(stderr, "Preprocessor failed on file: '%s'\n", qPrintable(fileName));
return 1;
Expand All @@ -148,16 +159,19 @@ int main(int argc, char *argv[])
if (args.contains("ast-to-xml")) {
printf("Running ast-to-xml on file [%s] using pp_file [%s] and include-paths [%s]\n",
qPrintable(fileName), qPrintable(pp_file), qPrintable(args.value("include-paths")));
ReportHandler::setContext(QString("AST-to-XML"));
astToXML(pp_file);
return 0;
}

printf("Building model using [%s]\n", qPrintable(pp_file));
ReportHandler::setContext("Build");
gs->buildModel(pp_file);
if (args.contains("dump-object-tree")) {
gs->dumpObjectTree();
return 0;
}
ReportHandler::setContext("Generate");
printf("%s\n", qPrintable(gs->generate()));

printf("Done, %d warnings (%d known issues)\n", ReportHandler::warningCount(),
Expand Down
Empty file added generator/touch
Empty file.

0 comments on commit 86a27b5

Please sign in to comment.