[C++-sig] BOOST_PYTHON_MODULE across several files

William Trenker wtrenker at hotmail.com
Tue Dec 24 16:52:11 CET 2002


Is there a way to spread a BOOST_PYTHON_MODULE definition across multiple
files?

Fltk, like any large library, has it's API spread across many header
files. Typically each file represents the declaration of one class.  And
some of fltk's classes have a few dozen public members each.

Ideally I'd like to split up the class_<> definitions into separate files
corresponding with the organization of fltk's header files.  I'm hoping to
develop a unit-testing architecture so each API wrapper file can be
testing independently.  Another reason is to avoid re-compiling the entire
source every time I make changes.  Of course these are conventional goals
/ requirements when a project gets to be any bigger than a single,
relatively small source file.

I can easily construct a small Python module to cut-and-paste the
BOOST_PYTHON_MODULE entries from each file into a single file for the
purposes of building the entire extension, but that would still represent
a lot of compiling for incremental changes.  Is there some way to compile
multiple BOOST_PYTHON_MODULE definitions into individual objects files and
then let the linker bring it all together under one Python module name?

Thanks,
Bill






More information about the Cplusplus-sig mailing list