##// END OF EJS Templates
florianlink -
r162:1182b71738ca
parent child
Show More
@@ -134,19 +134,25 int main(int argc, char *argv[])
134
134
135 printf("Please wait while source files are being generated...\n");
135 printf("Please wait while source files are being generated...\n");
136
136
137 printf("Parsing typesystem file [%s]\n", qPrintable(typesystemFileName));
137 if (!TypeDatabase::instance()->parseFile(typesystemFileName))
138 if (!TypeDatabase::instance()->parseFile(typesystemFileName))
138 qFatal("Cannot parse file: '%s'", qPrintable(typesystemFileName));
139 qFatal("Cannot parse file: '%s'", qPrintable(typesystemFileName));
139
140
141 printf("PreProcessing - Generate [%s] using [%s] and include-paths [%s]\n",
142 qPrintable(pp_file), qPrintable(fileName), qPrintable(args.value("include-paths")));
140 if (!Preprocess::preprocess(fileName, pp_file, args.value("include-paths"))) {
143 if (!Preprocess::preprocess(fileName, pp_file, args.value("include-paths"))) {
141 fprintf(stderr, "Preprocessor failed on file: '%s'\n", qPrintable(fileName));
144 fprintf(stderr, "Preprocessor failed on file: '%s'\n", qPrintable(fileName));
142 return 1;
145 return 1;
143 }
146 }
144
147
145 if (args.contains("ast-to-xml")) {
148 if (args.contains("ast-to-xml")) {
149 printf("Running ast-to-xml on file [%s] using pp_file [%s] and include-paths [%s]\n",
150 qPrintable(fileName), qPrintable(pp_file), qPrintable(args.value("include-paths")));
146 astToXML(pp_file);
151 astToXML(pp_file);
147 return 0;
152 return 0;
148 }
153 }
149
154
155 printf("Building model using [%s]\n", qPrintable(pp_file));
150 gs->buildModel(pp_file);
156 gs->buildModel(pp_file);
151 if (args.contains("dump-object-tree")) {
157 if (args.contains("dump-object-tree")) {
152 gs->dumpObjectTree();
158 gs->dumpObjectTree();
@@ -57,7 +57,7 void ReportHandler::warning(const QString &text)
57 if (db && db->isSuppressedWarning(warningText)) {
57 if (db && db->isSuppressedWarning(warningText)) {
58 ++m_suppressed_count;
58 ++m_suppressed_count;
59 } else if (!m_reported_warnings.contains(warningText)) {
59 } else if (!m_reported_warnings.contains(warningText)) {
60 qDebug(qPrintable(warningText));
60 qDebug("%s", qPrintable(warningText));
61 ++m_warning_count;
61 ++m_warning_count;
62
62
63 m_reported_warnings.insert(warningText);
63 m_reported_warnings.insert(warningText);
@@ -171,7 +171,9 void SetupGenerator::generate()
171
171
172
172
173 {
173 {
174 FileOut initFile(m_out_dir + "/generated_cpp/" + packName + "/" + packKey + "_init.cpp");
174 QString fileName(packName + "/" + packKey + "_init.cpp");
175 FileOut initFile(m_out_dir + "/generated_cpp/" + fileName);
176 ReportHandler::debugSparse(QString("generating: %1").arg(fileName));
175 QTextStream &s = initFile.stream;
177 QTextStream &s = initFile.stream;
176
178
177 s << "#include <PythonQt.h>" << endl;
179 s << "#include <PythonQt.h>" << endl;
@@ -264,7 +266,7 QStringList SetupGenerator::writePolymorphicHandler(QTextStream &s, const QStrin
264 handlers.append(handler);
266 handlers.append(handler);
265
267
266 s << "static void* polymorphichandler_" << handler
268 s << "static void* polymorphichandler_" << handler
267 << "(const void *ptr, char **class_name)" << endl
269 << "(const void *ptr, const char **class_name)" << endl
268 << "{" << endl
270 << "{" << endl
269 << " Q_ASSERT(ptr != 0);" << endl
271 << " Q_ASSERT(ptr != 0);" << endl
270 << " " << cls->qualifiedCppName() << " *object = ("
272 << " " << cls->qualifiedCppName() << " *object = ("
General Comments 0
You need to be logged in to leave comments. Login now