[Scons-users] bug with AddOption?

Gabe Black gabe.black at gmail.com
Thu Apr 28 17:04:32 EDT 2022


There seems to also be another problem here as well, although this one
might be a usage error on my part. It looks like if you use the --linker
option, you also have to use it in --linker=gold form, and can't use it as
two arguments, ie --linker gold. I think both *should* work, so this might
be another symptom of the first problem.

Gabe

On Thu, Apr 28, 2022 at 1:24 PM Gabe Black <gabe.black at gmail.com> wrote:

> Hi, we have a legacy option, --gold-linker, which takes no parameter, and
> a new option, --linker, which takes one option that may be "gold" or
> several other values. We set up both options using AddOption and give them
> both the same "dest", using the "store_const" action with const="gold" for
> --gold-linker.
>
> This *mostly* works, except it looks like SCons conflates the format of
> the two options, and *sort of* expects --gold-linker to have an option
> value after it, even though it's a "store_const". I say *sort of* since it
> doesn't look like --gold-linker actually consumes the value after it, it
> will just complain if the value after it is another option.
>
> I think SCons is either not realizing that this type of flag should not
> have a value after it, or is getting confused because these two differently
> formatted options store to the same place. Minimally this behavior is
> confusing.
>
> Gabe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20220428/c1f374bc/attachment.htm>


More information about the Scons-users mailing list