summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2009-12-29 13:15:45 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2009-12-29 15:42:28 -0300
commite67ea3ffab7c161785636b78c41f3b624ec0f5ab (patch)
tree3ba7bdc64d9e5bd1eaf44dbb142137b4db491cd1
parent9f79c3de8192c4ce5f0ae86687d3ece2196323ba (diff)
downloadshiboken-e67ea3ffab7c161785636b78c41f3b624ec0f5ab.tar.gz
shiboken-e67ea3ffab7c161785636b78c41f3b624ec0f5ab.tar.xz
shiboken-e67ea3ffab7c161785636b78c41f3b624ec0f5ab.zip
Generated module headers now include headers of required modules.
Example: "other" module depends on "sample" module, so the generated module header for "other" (i.e. "other_python.h") will include "sample_python.h". Of course the required module include path must be set by the build system.
-rw-r--r--headergenerator.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/headergenerator.cpp b/headergenerator.cpp
index a3391039..eba04a5f 100644
--- a/headergenerator.cpp
+++ b/headergenerator.cpp
@@ -281,6 +281,14 @@ void HeaderGenerator::finishGeneration()
s << "#include <memory>" << endl << endl;
writeExportMacros(s);
+ QStringList requiredTargetImports = TypeDatabase::instance()->requiredTargetImports();
+ if (!requiredTargetImports.isEmpty()) {
+ s << "// Module Includes" << endl;
+ foreach (const QString& requiredModule, requiredTargetImports)
+ s << "#include <" << getModuleHeaderFileName(requiredModule) << ">" << endl;
+ s << endl;
+ }
+
s << "// Class Includes" << endl;
s << classIncludes << endl;