[Scons-users] SWIG

Bill Deegan bill at baddogconsulting.com
Tue Mar 10 23:56:03 EDT 2015


William,

If you want more control, you might break out.

xyz= env.SharedObject('targetdir/file','sourcefile.i',SWIGFLAGS=['-python',
'-outdir', 'out/lib'])
And then use all or part of xyz

Also note that all builders should be treated as if they return a list of
Node objects.
So your:
return [l, x]

Should likely be:
return l+x

-Bill

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

>
>
> 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
>
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20150310/a87e865b/attachment-0001.html>


More information about the Scons-users mailing list