[Scons-users] Two-level suffixes

Paweł Tomulik ptomulik at meil.pw.edu.pl
Fri Oct 26 18:40:51 EDT 2018


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!

-- 
Pawel Tomulik


More information about the Scons-users mailing list