[pygccxml-development] Help with single header setup
Brought to you by:
mbaas,
roman_yakovenko
From: Brendan D. <Bre...@di...> - 2009-07-30 16:00:27
|
I've been testing Py++ lately as an alternative to swig. Some of the libraries I'm trying to wrap cause Py++/PyGCCXML to consume well over 6GB of RAM, and take quite a while to process (considerably longer than swig). I read the section of documentation that said putting all of the headers into a single header is the way to go. This is where I'm stuck, and I don't have a lot of time to try and figure it out. Here's a greatly simplified version of what I'm currently doing. Can anyone tell me what I need to be doing instead? Foo.h: class Foo { public: Foo(void) { } void test(void) { } }; headers.h: #include "Foo.h" generate.py: from pyplusplus import module_builder GCCXML = '/path/to/gccxml' mb = module_builder.module_builder_t(files=['headers.h'], gccxml_path=GCCXML) mb.build_code_creator(module_name='_test') targets = mb.split_module('build') When I run generate.py, it produces _test.main.cpp: #include "boost/python.hpp" #include "headers.h" namespace bp = boost::python; BOOST_PYTHON_MODULE(_test){ } If instead of headers.h I pass Foo.h to module_builder_t, then it builds fine, except this is the case where in my large project it consumes far too much memory and takes too long. I tried having the pygccxml parser generate an xml for headers.h and passing that to module_builder, but that didn't work either. Looking at the xml file I do see the Foo declarations though, so it's just module_builder that's ignoring them. Any ideas would be greatly appreciated. I'm using the SVN version, on Linux (if that matters). Thanks, Brendan |