Re: Odd --tree output with out-of-source build

Hartmut Brandt <[email protected]>
Newsgroups gmane.comp.programming.tools.scons.user
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.