blob: 6a3fd05a59297b399a0d3777d850531eed0f701e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# SPDX-License-Identifier: MIT
#
# Copyright The SCons Foundation
import sys
DefaultEnvironment(tools=[])
env = Environment(tools=['python'])
# Copy each file individually instead of copying the dir. This has the benefit
# of establishing nodes in-memory for each of the resulting files, which helps
# the scanner work correctly.
srcDir = env.Dir('to_be_copied')
for srcNode in srcDir.glob('*'):
for destDir in [env.Dir('package1'), env.Dir('package2')]:
env.Command(destDir.File(srcNode.name), srcNode,
Copy('$TARGET', '$SOURCE'))
# Don't set a dependency on the copy actions on purpose. Scanner should find
# the dependencies automatically.
env.Command('a.out', 'script.py', '$PYTHON $SOURCE $TARGET', PYTHON=sys.executable)
|