[Scons-users] scons not respecting variant_dir with object files

Bob Loblaw bloblaw2890397140971 at outlook.com
Sun Jun 5 15:11:39 EDT 2016


For simplicity sake, I'm able to reproduce this problem I'm having with the following example...

I currently have two files, a SConstruct and a SConscript.

My directory tree is as follows:

- .
    - SConstruct
    - build (dir)
    - dir1 (dir)
        - mysrc.cpp
        - proj (dir)
            - SConscript
Here is the contents of my SConstruct:

#####
SConscript('dir1/proj/SConscript', variant_dir='build/out', duplicate=0)
#####

Here is the contents of dir1/proj/SConscript:

#####
src = Dir('.').srcnode().abspath + '/../mysrc.cpp'
StaticLibrary('mylib', src)
#####

When I run scons at my root directory, I see the following output:

g++ -o dir1/mysrc.o -c dir1/mysrc.cpp
ar rc build/out/libmylib.a


The ar command looks great, it outputs to the variant_dir, which is build/out. The problem here is the output location of mysrc.o. It goes to dir1 instead of build/out. Why does this happen? Is this a scons bug?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20160605/7c562bbd/attachment.html>


More information about the Scons-users mailing list