[Scons-users] Includes from sibling directory

Gaurav Juvekar gauravjuvekar at gmail.com
Sun Apr 2 02:11:34 EDT 2017


On 2017-04-02 00:30, Jean-Baptiste Lab wrote:
> I believe the SCons developers didn't want to risk choosing one interpretation over another and implemented the search algorithm to strictly look at files that are accessible in the directories listed in the  CPPPATH variable.

However, this does work if I add one more directory from the project root (i.e. if the variant directory is never under any directory in the relative path.)
The problem I think is in SCons/Node/FS.py:srcdir_duplicate().
Any time the variant build directory is under the one of the directories in the (relative include path), the path isn't further scanned to prevent reflection. Basically, because 'build' is under '..', search is halted, (because of the possibility that reflection would occur if the path is '../build/...' instead of '../include/...').

The attached modified test case which moves both src and include within another folder (so that 'build' is never under '..') works correctly with relative paths.

I think this is a bug as relative includes seem to be correctly supported (relative to the source file which has the include), except in the case where the variant build directory is under one of the directories in the include path.

Gaurav Juvekar
-------------- next part --------------
A non-text attachment was scrubbed...
Name: include-siblingdir-never-above-variant.py
Type: text/x-python
Size: 2508 bytes
Desc: not available
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20170402/f6000934/attachment.py>

More information about the Scons-users mailing list