[Scons-users] [c++] Automatically choosing sources for linking
Dirk Bächle
tshortik at gmx.de
Sat Mar 29 20:33:26 EDT 2014
On 29.03.2014 22:10, Scott Davies wrote:
> I'm playing with the dependency calculation stuff in SCons using
> http://www.scons.org/wiki/ExplicitlyCallCppScanner as a starting
> point, and have immediately hit two problems.
>
> 1) I'm having trouble getting the scanner to pay any attention to
> CPPPATH...as far as I can tell it's behaving as if the path is always
> set to '.'.
>
> Simple example (note how c.h doesn't show up as a dependency despite
> CPPPATH being set in the environment):
>
> [...]
>
> Any idea what might be going on here? (I'm a newbie at both SCons and
> Python, so I'm probably doing something stupid.)
>
Looks like you need
includes = scanner(f, env, scanner.path_function(env))
instead of
includes = scanner(f, env)
. Looks a bit magic and I don't want to go into all the gory details
about it right now. Instead I'll update the Wiki page accordingly, as
soon as I find the time.
>
>
> 2) In another test on my actual codebase, if I use
> SCons.Scanner.C.SConsCPPScannerWrapper('prescanner','.') rather
> than SCons.Scanner.C.CScanner(), the scanner crashes (causing scons to
> terminate) on one of my source files thusly:
>
The current scanner doesn't support full expansion and tracking of
macros, and probably never will. However, an issue report would help
here because the parsing shouldn't crash...
Dirk
More information about the Scons-users
mailing list