forked from SCons/scons
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSConstruct
More file actions
35 lines (31 loc) · 940 Bytes
/
SConstruct
File metadata and controls
35 lines (31 loc) · 940 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# SPDX-License-Identifier: MIT
#
# Copyright The SCons Foundation
def b(target, source, env):
with open(target[0], 'wb') as f:
f.write((env['X'] + '\n').encode())
DefaultEnvironment(tools=[])
env1 = Environment(X='111', tools=[])
env2 = Environment(X='222', tools=[])
B = Builder(action=b, env=env1, multi=1)
print("B =", B)
print("B.env =", B.env)
env1.Append(BUILDERS={'B': B})
env2.Append(BUILDERS={'B': B})
env3 = env1.Clone(X='333')
print("env1 =", env1)
print("env2 =", env2)
print("env3 =", env3)
f1 = env1.B(File('file1.out'), [])
f2 = env2.B('file2.out', [])
f3 = env3.B('file3.out', [])
def do_nothing(env, target, source):
pass
AddPreAction(f2[0], do_nothing)
AddPostAction(f3[0], do_nothing)
print("f1[0].builder =", f1[0].builder)
print("f2[0].builder =", f2[0].builder)
print("f3[0].builder =", f3[0].builder)
print("f1[0].env =", f1[0].env)
print("f2[0].env =", f2[0].env)
print("f3[0].env =", f3[0].env)