Commit b01ae28a authored by Jonas Jelten's avatar Jonas Jelten 🥕
Browse files

pybind: only export enums in their module

parent 19abf8f3
Pipeline #738927 passed with stages
in 33 minutes and 16 seconds
......@@ -221,7 +221,7 @@ public:
if (!fullLocation.isValid())
return true;
if (declaration->isClass() || declaration->isStruct()) {
if (declaration->isClass() || declaration->isStruct() || declaration->isEnum()) {
m.includes.insert(getHeaderLocation(declaration));
parseRecord(declaration);
......@@ -260,6 +260,13 @@ public:
if (encounteredEnums.find(id) != encounteredEnums.end())
return;
// only record an enum when its in the current module,
// otherwise we get double-definitions when they are included
// between modules
if (fileLocation(declaration).find(m.path) != 0) {
return;
}
auto e = std::make_unique<elsa::Module::Enum>();
e->name = id;
......@@ -830,4 +837,4 @@ int main(int argc, const char** argv)
Generator::generateBindingsForModule(m, outputDir);
return 0;
}
\ No newline at end of file
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment