I am writing a C++ extension for Python using SWIG. From what I understand of Python and SWIG, each module must have its own .pyd file. For example, if I have a module named 'mymodule', there should be a corresponding '_mymodule.pyd' file.
In my particular case, I would like to have only one 'pyd' file and multiples modules linking to it.
mypackage/
mypackage/__init__.py
mypackage/module1.py
mypackage/module2.py
I don't want to have to maintain multiples .pyd, so I can put my interface (.i) files all under the same project in VS2010.
Edit: So far, the only way I have been able to make it work is by duplicating my 'pyd' file into two new files: _module1.pyd and _module2.pyd. But I don't like this solution, because I need to duplicate the 'pyd' file of 30 Mo unnecessarily. I would prefer the modules to link to one '_package.pyd' file.
What is the best way of doing that?
Finally, the easiest way and "correct" way of doing that is by creating multiple projects calling only some exposed parts of the big monolithic project. The smaller projects will be parsed by SWIG to create the Python modules. Works like a charm.