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

Gary Oberbrunner garyo at oberbrunner.com
Fri Jan 4 16:38:21 EST 2019


For any significant SCons project, I always use something like
Default(Alias("DefaultBuild")). Then I add targets to that alias if they
should be in the default build. And I create other aliases for optional
targets. I find that only rarely is the SCons default of building '.' what
I really want by default.

BTW, it's simple to add to an Alias even without passing it around;
Alias("DefaultBuild", my_target) works to add to it from anywhere deep in
the build.

-- Gary

On Fri, Jan 4, 2019 at 4:09 PM Mats Wichmann <mats at wichmann.us> wrote:

>
> 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.
>
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>


-- 
Gary
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20190104/53894ce8/attachment.html>


More information about the Scons-users mailing list