[Scons-users] Odd --tree output with out-of-source build

Hartmut Brandt hartmut.brandt at dlr.de
Fri Mar 18 10:17:02 EDT 2022


On Fri, 18 Mar 2022, Mats Wichmann wrote:

MW>On 3/18/22 07:46, Hartmut Brandt wrote:
MW>
MW>> MW>> which looks odd. Are out-of-tree builds not supported? Could not find
MW>> MW>> such a hint in the documentation, but I could easily miss it.
MW>> MW>
MW>> MW>Supported, but this is a matter of target selection. SCons does not by
MW>> MW>default select targets outside the tree, so in your out-of-tree
MW>> MW>example,nothing in the variant dir is selected for building, so there's
MW>> MW>nothing to report on there.
MW>> MW>
MW>> MW>https://scons.org/doc/production/HTML/scons-man.html#target_selection
MW>> 
MW>> So how do I specify these targets? I would assume I need to specify foo 
MW>> with some path like /home/harti/build/play/sub1/foo or just the directories.
MW>> None of this works. scons tells me either that it doesn't know how to 
MW>> build it or it spits out a python error ('NoneType' object has no 
MW>> attribute 'get_contents').
MW>
MW>Hmmm, the path to the build directory should work. Perhaps the quickest
MW>way is to use '/' as the target name.
MW>
MW>scons --tree=prune /
MW>
MW>should do what you want.

Ok, seems if I put the correct build directory into the SConscript() 
function (I had /home/harti/build/play instead of 
/home/harti/build/play/sub1) and call the Default() function with the root 
of the build things work. This works also when the build directory is in 
the tree. So it looks like I got what I want: builds without arguments 
whether the build directory is in-tree or out-of-tree.

Thanks for your help,
harti


More information about the Scons-users mailing list