[Scons-dev] Subst API...
Gary Oberbrunner
garyo at oberbrunner.com
Mon Oct 1 17:23:33 EDT 2012
On Mon, Oct 1, 2012 at 5:10 PM, Kenny, Jason L <jason.l.kenny at intel.com> wrote:
> No they don't pass,
>
> Sort of why I was asking as I having difficulty understanding what is going on ( so I not sure what broke). There seems to be some odd logic here in that we do a test like:
>
> If prefix[:-1] == " ":
> result.append(prefix[:-1])
>
> I ask myself so why do we do with "foo " ( ie two spaces)
I'm not sure what you're asking above, and your cut & paste is a
little off. The intent is, if the prefix ends with a space, add the
prefix (without the space) to the result list as a separate element.
That supports linkers that instead of -lfoo might need -l foo as two
args. (Note that without this, it would end up getting quoted by the
quoting logic as "-l foo").
> I guess I need to study this better.
>
> Then there is the case of node pass through.. which makes me wonder why this is here as we don't add anything, which seems to be the point of having this called. More so I would wonder why it is for file nodes, not any other type of node. Ie value and directory nodes would be turned in to a string, while a file node would continue and be turned in to the string but the calling subst() call. This seems a little special cased.
If you think about LIBS, you mostly want the pre/suffixes added (-lfoo
for instance). But passing through File nodes allows you to specify a
particular version of a lib (as well as static vs. shared) by passing
a Node representing the file. I don't think there's a use case for
Value nodes, so who knows what the right thing is. Directory nodes
are interesting; one could argue they should be passed through as
well, for the same kinds of reasons. I just don't think this code
gets called on Directory nodes much.
--
Gary
More information about the Scons-dev
mailing list