[Scons-users] Default() and Ignore() - seem a little awkward

Mats Wichmann mats at wichmann.us
Fri Jan 4 16:09:34 EST 2019


This is a followon from my earlier thread "optional build components,"
but it's a distinct observation since it's based on experiment.


I tried using Default in a directory that contains only example code,
and since I don't want to build that example I said Default(None).

That broke the entire build, which now concluded:

scons: done reading SConscript files.
scons: *** No targets specified and no Default() targets found.  Stop.

Okay, so makes sense if I stop and think that calling that in the global
sense would cause problems, so I tried again with
some_env.Default(None), but got the same result.  However, if I specify
one target (omitting the others) using the second form, it works as
requested, building only that one target and not the others.

So it looks like env.Default cannot be used to avoid building in a
directory (or rather in a construction environment, it just happens the
two are used equivalently in much of this project) by saying it has no
defaults.

===

Switching to trying to use Ignore instead has a different interesting
side effect - only the end binary is omitted.  That is, this sequence:

rd_queryClient = rd_sample_app_env.Program('rd_queryClient',
                                           'rd_queryClient.cpp')
Ignore(".", "rd_queryClient")

left me with a built object over in the variant dir:

foo/Archived/examples/rd_queryClient.o


which is certainly not the end of the world, but also not quite what I
expected.


Not descending into this directory isn't convenient - if I avoid calling
sconscript in that directory, then the target won't even be seen, and so
could not be called from the command line, which was the other
requirement I have (or think I have, maybe we can discuss that).


So this is all feeling kind of awkward.




More information about the Scons-users mailing list