[Scons-users] SWIG

William Roberts bill.c.roberts at gmail.com
Tue Mar 10 21:07:55 EDT 2015


On Tue, Mar 10, 2015 at 6:03 PM, William Roberts <bill.c.roberts at gmail.com>
wrote:

> So I have a heiarchical biuld going on, my SConstruct defines this method
> that is exported to my SConscripts
>
> def buildSharedLibrary(*args, **kwargs):
>         l = env.SharedLibrary(*args, **kwargs)
>         x = env.Install(libdir, l)
>         return [l, x]
>
> So all my shared libraries end up in out/lib
>
> I am currently trying to make a swig wrapper, and my SConstruct defines:
>
> buildSharedLibrary('_miniat.so', 'src/miniat.i', LIBS=['miniat'],
> CPPPATH=[ INC, distutils.sysconfig.get_python_inc() ], SHLIBPREFIX="",
> SWIGFLAGS=['-python'])
>
> Which builds the wrapper into a shared object just fine. However, swig
> outputs a generated python file at:
> ./out/vm/src/miniat.py
>
> What I am trying to do, is get SCons to install this into the
> SharedLibrary directory, but it doesn't seem to be ommited here:
> l = env.SharedLibrary(*args, **kwargs)
>
> How can I get that generated file output where I want it?
>
>
>
As usual, just after I sent I found what I was looking for:

buildSharedLibrary('_miniat.so', 'src/miniat.i', LIBS=['miniat'], CPPPATH=[
INC, distutils.sysconfig.get_python_inc() ], SHLIBPREFIX="",
SWIGFLAGS=['-python', '-outdir', 'out/lib'])

But is this the best way?





> --
> Respectfully,
>
> William C Roberts
>
>


-- 
Respectfully,

William C Roberts
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20150310/c1c7b282/attachment.html>


More information about the Scons-users mailing list