diff options
-rw-r--r-- | cppgenerator.cpp | 4 | ||||
-rw-r--r-- | headergenerator.cpp | 8 | ||||
-rw-r--r-- | shibokengenerator.cpp | 7 | ||||
-rw-r--r-- | shibokengenerator.h | 4 |
4 files changed, 17 insertions, 6 deletions
diff --git a/cppgenerator.cpp b/cppgenerator.cpp index 72c4f824c..53f2ac0a8 100644 --- a/cppgenerator.cpp +++ b/cppgenerator.cpp @@ -96,7 +96,7 @@ void CppGenerator::generateClass(QTextStream &s, const AbstractMetaClass *metaCl if (hasMultipleInheritanceInAncestry(metaClass)) s << "#include <set>" << endl; - s << "#include \"" << moduleName().toLower() << "_python.h\"" << endl << endl; + s << "#include \"" << getModuleHeaderFileName() << '"' << endl << endl; QString converterImpl; QTextStream convImpl(&converterImpl); @@ -2270,7 +2270,7 @@ void CppGenerator::finishGeneration() s << "#include <Python.h>" << endl; s << "#include <shiboken.h>" << endl; - s << "#include \"" << moduleName().toLower() << "_python.h\"" << endl << endl; + s << "#include \"" << getModuleHeaderFileName() << '"' << endl << endl; foreach (const QString& include, includes) s << "#include \"" << include << '\"' << endl; s << endl; diff --git a/headergenerator.cpp b/headergenerator.cpp index 48d3e587c..f160fe870 100644 --- a/headergenerator.cpp +++ b/headergenerator.cpp @@ -253,11 +253,11 @@ void HeaderGenerator::finishGeneration() } } - QString moduleHeaderFileName(outputDirectory() + QDir::separator() - + subDirectoryForPackage(packageName())); - moduleHeaderFileName += QDir::separator() + moduleName().toLower() + "_python.h"; + QString moduleHeaderFileName(outputDirectory() + + QDir::separator() + subDirectoryForPackage(packageName()) + + QDir::separator() + getModuleHeaderFileName()); - QString includeShield = moduleName().toUpper() + "_PYTHON_H"; + QString includeShield("SBK_" + moduleName().toUpper() + "_PYTHON_H"); QFile file(moduleHeaderFileName); if (file.open(QFile::WriteOnly)) { diff --git a/shibokengenerator.cpp b/shibokengenerator.cpp index 2094749fc..ba3d03e35 100644 --- a/shibokengenerator.cpp +++ b/shibokengenerator.cpp @@ -1149,6 +1149,13 @@ QString ShibokenGenerator::getApiExportMacro() const return "SHIBOKEN_"+moduleName().toUpper()+"_API"; // a longer name to avoid name clashes } +QString ShibokenGenerator::getModuleHeaderFileName(QString modName) const +{ + if (modName.isEmpty()) + modName = moduleName(); + return QString("%1_python.h").arg(modName.toLower()); +} + /* static void dumpFunction(AbstractMetaFunctionList lst) { diff --git a/shibokengenerator.h b/shibokengenerator.h index beb88e4c6..f7a79e708 100644 --- a/shibokengenerator.h +++ b/shibokengenerator.h @@ -257,6 +257,10 @@ public: /// Returns the name of the macro used to export symbols QString getApiExportMacro() const; + + /// Returns the file name for the module global header. If no module name is provided the current will be used. + QString getModuleHeaderFileName(QString moduleName = QString()) const; + QMap< QString, QString > options() const; /// Returns true if the user enabled the so called "parent constructor heuristic". |