[Scons-users] Includes from sibling directory

Jean-Baptiste Lab jeanbaptiste.lab at gmail.com
Sat Apr 1 15:00:53 EDT 2017


Hi Gaurav,

I'm afraid this is the intended behaviour as if I remember correctly, there are some ambiguities as to how relative paths are to be interpreted in the various C standards (are these paths relative to the source file's directory? Relative to the directory from where the compiler was invoked? Relative to the compiler installation directory, etc). 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.
I may be wrong, but that's what I remember from back when I was SCons building C code (7 years ago, so things may have changed...).

Hope this helps,

JB

On 1 April 2017 19:43:35 CEST, Gaurav Juvekar <gauravjuvekar at gmail.com> wrote:
>Hi,
>
>I didn't get any replies on about this question posted in January. Can
>anyone confirm if this is a bug. Should I raise it on the tigris bug
>tracker?
>I'm re-attaching the test case.
>
>
>On 2017-01-16 15:43, Gaurav Juvekar wrote:
>> Hi,
>> 
>> Manually adding a
>> env.Depends("a.o", "../include/a.h")
>> in src/SConscript works.
>> 
>> Is this a bug in the C file scanner?
>> 
>> I am attaching a test case based on test/VariantDir/include-subdir.py
>> Regards,
>> Gaurav Juvekar
>> 
>> On 01/11/2017 10:26 AM, Gaurav Juvekar wrote:
>>> Hi,
>>>
>>> Does SCons properly set dependencies for header files in a sibling
>>> directory in a variant build?
>>>
>>> I have a structure like
>>> src/a.c
>>> include/a.h
>>> tests/test_a.c
>>>
>>> where a.c has #include "../include/a.h"
>>>
>>> The include dependency is not automatically tracked by SCons.
>>>
>>> I've set up the example at
>>> https://github.com/gauravjuvekar/scons-includes-in-parent-dep-scan
>>>
>>> I know that it will work if I add the include directory to CPPPATH.
>Is
>>> there a way to do it without changing CPPPATH?
>>>
>
>
>-- 
>Regards,
>Gaurav Juvekar

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20170401/01fff5f9/attachment.html>


More information about the Scons-users mailing list