Skip to content

Create action translator for Textfile builder to ninja #4156

Open
@dmoody256

Description

@dmoody256

The Textfile builder could have an automatic translator to prevent needing to callback to scons, similar to the MkDir or Copy Builder:

def _mkdir_action_function(env, node):
return {
"outputs": get_outputs(node),
"rule": get_rule(node, "GENERATED_CMD"),
# implicit explicitly omitted, we translate these so they can be
# used by anything that depends on these but commonly this is
# hit with a node that will depend on all of the fake
# srcnode's that SCons will never give us a rule for leading
# to an invalid ninja file.
"variables": {
# On Windows mkdir "-p" is always on
"cmd": "mkdir {args}".format(
args = ' '.join(get_outputs(node)) + " & exit /b 0" if env["PLATFORM"] == "win32" else "-p " + ' '.join(get_outputs(node)),
),
},
}

This was requested by a user in the scon's user mailing list thread: https://pairlist4.pair.net/pipermail/scons-users/2022-May/008985.html

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions