ReplacingBuilder¶
-
class
sconstool.util.
ReplacingBuilder
(wrapped, replacements={}, **kw)[source]¶ SCons builder wrapper, calls the wrapped builder with replaced construction variables.
Example: Typical usage The following builder named
MyObject
is similar to SConsObject
builder, but it usesMY_CFLAGS
instead ofCFLAGS
.from sconstool.util import ReplacingBuilder from SCons.Environment import Environment env = Environment(tools=['default'], MY_CFLAGS=['-Wall', '-Wextra']) bld = ReplacingBuilder(env['BUILDERS']['Object'], CFLAGS='MY_CFLAGS') env['BUILDERS']['MyObject'] = bld bld.inject_replacements(env, 'SetDefault') env.MyObject('test1.c') # gcc -c -o test1.o -Wall -Wextra test1.c env.Object('test2.c') # gcc -c -o test2.o test2.c
Parameters: - wrapped – callable object, initializes
wrapped
, - replacements (dict) – initializes
replacements
, - kw – keyword arguments used to initialize
replacements
.
- wrapped – callable object, initializes