logo       

Re: dependant modules: msg#00147

programming.swig

Subject: Re: dependant modules

On Mon, Jan 27, 2003 at 08:46:35AM -0500, Blezek, Daniel J (Research) wrote:
> Since libswigpy is not distributed under Windows, I made
> an empty module like this:
>
> %module InsightRuntime
>
> %runtime
> %{
> #define SWIG_GLOBAL
> %}
> // Dummy module to create the runtime library
>
> Ran swig -c++ ...
>
> To compile, you must use -DSWIG_GLOBAL (or it's equivalent under VC++). This
> produces the equivalent
> of the runtime code in a module. Just link other modules against it.
>
> I found this solution worked equally well under Linux, and was more
> satisfactory than libswigpy.

Thanks for the idea!

I ran into one snag.. The above .i file puts the #define down around
line 600 for me, which is well past where it would be used and so it
goes ignored. The solution for me was to add a .i with just the
following:

%module swigruntime

And compile it without -c, while compiling the others with -c. Then
using -DSWIG_GLOBAL in my CFLAGS for everything. I expected I might
get some linker clashes from this but it went smoothly. I'll have to
dig around the automake docs to see if i can set it for just the
swigruntime.cc.

Thanks again,
Natas
--
I am damn unsatisfied to be killed in this way.

http://www.icculus.org/openbox/

Attachment: pgp3SU9vfH8Ej.pgp
Description: PGP signature

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise