diff --git a/cppwg/info/module_info.py b/cppwg/info/module_info.py index 552ac28..7b0d6a3 100644 --- a/cppwg/info/module_info.py +++ b/cppwg/info/module_info.py @@ -173,9 +173,7 @@ def compare(a: CppClassInfo, b: CppClassInfo) -> int: cache[(b, a)] = 0 return 0 - self.class_collection.sort( - key=lambda x: (os.path.dirname(x.source_file_path), x.name) - ) + self.class_collection.sort(key=lambda x: x.name) i = 0 n = len(self.class_collection) diff --git a/cppwg/writers/module_writer.py b/cppwg/writers/module_writer.py index 0edb345..50fca41 100644 --- a/cppwg/writers/module_writer.py +++ b/cppwg/writers/module_writer.py @@ -62,10 +62,14 @@ def write_module_wrapper(self) -> None: Example output: ``` - #include #include "Foo.cppwg.hpp" + #include + #include "Foo.cppwg.hpp" + #include "Bar.cppwg.hpp" - PYBIND11_MODULE(_packagename_modulename, m) { + PYBIND11_MODULE(_packagename_modulename, m) + { register_Foo_class(m); + register_Bar_class(m); } ``` """