[Scons-users] Why is File() changing the path I give it?

Luke Robison lukerobison at gmail.com
Fri Apr 17 16:20:09 EDT 2020


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20200417/9536d863/attachment.html>


More information about the Scons-users mailing list