[C++-sig] Pyste: serious bug with --multiple.
Prabhu Ramachandran
prabhu at aero.iitm.ernet.in
Mon Jul 7 15:03:55 CEST 2003
Hi,
Found a serious bug with Pyste's --multiple option. It would not mix
up the declarations and put them in wrong files. I've attached a
patch that fixes this problem.
Generating only one file per --multiple is nice but still has the old
problem where if I change one interface file I need to wait several
minutes for pyste (gccxml actually) to regenerate the files.
Nicodemus suggested that a --xml-cache option would be useful.
However even with that option you'd generate many xml files and will
need to keep track of those files etc. Instead I have a much simpler
approach that will solve much of our problems.
1. Add a --only-wrap option that will process any number of interface
files and will generate the necessary wrapper code and *will not*
generate a _main.cpp file. Further, it will add an extra function
to each _interface_name.cpp file that reads something like this:
void _interface_name_module_init()
{
Export_SomeClass();
Export_SomeHeader_H();
// ...
}
2. The --multiple option with the --only-main option will simply
create a _main.cpp with something like this:
void _interface_name_module_init();
BOOST_PYTHON_MODULE(module_name)
{
_interface_name_module();
// ...
}
Note that the above does not need to use gccxml at all since it
only needs the interface file names. This should make it possible
to selectively compile individual interfaces via --multiple
--only-wrap and then generate a _main.cpp separately using all the
interfaces very quickly.
There are other issues not related to the above also but I won't go
into them here.
I'm going to go ahead and implement --only-main and --only-wrap on my
copy of the code here and will submit it to the list if it works
nicely. I'll let you folks decide if it goes into CVS or not.
cheers,
prabhu
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Pyste1.patch
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20030707/b7954d91/attachment.txt>
More information about the Cplusplus-sig
mailing list