[Scons-users] Two-level suffixes
Paweł Tomulik
ptomulik at meil.pw.edu.pl
Fri Oct 26 18:45:25 EDT 2018
W dniu 27.10.2018 o 00:40, Paweł Tomulik pisze:
> I'm trying to add an action to CXXFile builder for source suffix '.t.h'
> which shall map to target suffix '.t.cpp'. Can't get it working
>
> import SCons.Tool
> _, cxx = SCons.Tool.createCFileBuilders(env)
> cxx.add_action('.t.h', my_action) # this works well, but..
> cxx.suffix.update({'.t.h': '.t.cpp'}) # this mapping does not work.
>
> trying with emitter, that is:
>
> cxx.add_emitter('.t.h', my_emitter)
>
> does not work as well. The problem is, that whereas the SCons machinery
> for selecting actions for source suffixes is able to handle suffixes
> with dots in it (as in'.t.h'), the machinery for selecting target suffix
> or emitter only handles suffixes without dots in the middle, such as
> '.h', but not '.t.h'. The involved parts of SCons code is around
> SCons.Util.Selector and File.get_suffix().
>
> Is this discrepancy a part of some concept, or just an accident that
> should be fixed?
>
> Best regards!
>
I should mention that "does not work" means that for a '.t.h', correct
action is invoked, but for a source "foo.t.h", "foo.cc" is set to be
$TARGET for the action (instead of "foo.t.cpp", as I would expect). In
case of emitter - the emitter assigned to ".t.h" is not called.
--
Pawel Tomulik
More information about the Scons-users
mailing list