summaryrefslogtreecommitdiff
path: root/tools/build/example/generate/gen.py
blob: 09ee15b43a16418338ea293985a57c21b47844ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

from b2.build.virtual_target import NonScanningAction, FileTarget

def generate_example(project, name, ps, sources):

    result = []
    for s in sources:

        a = NonScanningAction([s], "common.copy", ps)

        # Create a target to represent the action result. Uses the target name
        # passed here via the 'name' parameter and the same type and project as
        # the source.
        result.append(FileTarget(name, s.type(), project, a))

    return result