[Scons-users] Replace env['BUILDERS']['Program'] and env.Configure
Luc Bourhis
luc_j_bourhis at mac.com
Fri Aug 24 04:52:54 EDT 2012
Hi Bill,
thanks for spending time to give me good advices.
>> I am dealing with an existing build system creating many an executable with env.Program(...) and many a shared library with env.SharedLibrary(...). As part of a recent changeset, I have a piece of code that I have built into a static library libofmine.a and a shared library libofmine.so. Then I wish that every executable is linked with libofmine.a whereas every shared library is linked with libofmine.so.
>
> Sounds like you could get into trouble if the programs link with any of those shared libraries..
I have that under control as those shared libraries are Boost Python extensions whereas the executables have nothing to do with Python.
>>> You could use a pseudo-builder
>>
>> Indeed but that would require changing all the env.Program(...) to env.MyProgram(...) and forcing all my collaborators to switch to that. I preferred to try a more transparent approach.
>
> I'm always wary of any "magic which happens behind the curtain" type solutions.
> Eventually there'll be an issue and then debugging it is a much bigger cost than a clean solution up front. (IHMO)
Generally speaking I fully agree with you and I had quite a dilemma here.
>> It seemed impossible to modify the environment by Append'ing a library in such a manner that env.Program would pick the static version whereas env.SharedLibrary would pick the shared version. If there is a way to do that, then I would adopt it immediately!
>
> If you create the shared and static libraries into different directories, then it should be fairly easy.
I am afraid I can't imagine how to do that still.
Best wishes,
Luc
More information about the Scons-users
mailing list