Re: Two-level suffixes

Paweł Tomulik <[email protected]>
Newsgroups gmane.comp.programming.tools.scons.user
Organization WUT
Message-ID <[email protected]>
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
_______________________________________________
Scons-users mailing list
[email protected]
https://pairlist4.pair.net/mailman/listinfo/scons-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.