[Scons-users] Why is File() changing the path I give it?
Bill Deegan
bill at baddogconsulting.com
Thu Apr 23 14:57:57 EDT 2020
File() creates a node in SCons's datastructures.
It does not create a string to hold the representation of that file you
passed to File().
SCons has a canonical representation of files and also how to generate
strings from that representation.
Does that help?
On Fri, Apr 17, 2020 at 1:20 PM Luke Robison <lukerobison at gmail.com> wrote:
> I'm trying to explicitly add dependencies to an scons build with multiple
> subdirectories and variant_dir builds. My custom add dependency function
> goes something like this (trying to make my build_tgt depend on lib.
> built_libname = env['LIBPREFIX'] + lib + env['LIBSUFFIX']
> full_name = env.Literal("{}/{}/build-{}/{}".format(env.Dir('#'
> ).abspath,lib,self.short_flavor(env),built_libname))
>
> # full_name is like "/c/robison/code/xorshift/build-gd/libxorshift.a"
> build_dep = env.File(full_name)
>
> # build_dep is like "/c/robison/code/xorshift/source/libxorshift.a"
> env.Depends( build_tgt, build_dep )
>
> But I am completely confused as to why the File() function changing the
> path out from under me (see the inline comments). It seems to be replacing
> a variant_dir with "source" when the explicitly given path does not exist
> (which is often the case on a fresh build)
>
> For some context, my Sconstruct is at code/, and my Sconscript files are
> in code/<library>/source/Sconscript
> _______________________________________________
> 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/20200423/31adb058/attachment.html>
More information about the Scons-users
mailing list