mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-19 18:15:50 +00:00
Handle protoc targets in scons ninja build
This commit is contained in:
@@ -1231,7 +1231,8 @@ for tu_style in ['classic', 'unity']:
|
||||
if should_build_ninja(tu_style, toolchain, variant):
|
||||
print('Generating ninja: {}:{}:{}'.format(tu_style, toolchain, variant))
|
||||
scons_to_ninja.GenerateNinjaFile(
|
||||
[object_builder.env] + object_builder.child_envs,
|
||||
# add base env last to ensure protoc targets are added
|
||||
[object_builder.env] + object_builder.child_envs + [base],
|
||||
dest_file='build.ninja')
|
||||
|
||||
for key, value in aliases.iteritems():
|
||||
|
||||
@@ -37,13 +37,12 @@ def GenerateNinjaFile(envs, dest_file):
|
||||
node_list = []
|
||||
node_map = {}
|
||||
def CustomCommandPrinter(cmd, targets, source, env):
|
||||
assert len(targets) == 1, len(targets)
|
||||
node = targets[0]
|
||||
# There can sometimes be multiple commands per target (e.g. ar+ranlib).
|
||||
# We must collect these together to output a single Ninja rule.
|
||||
if node not in node_map:
|
||||
node_list.append(node)
|
||||
node_map.setdefault(node, []).append(cmd)
|
||||
for node in targets:
|
||||
# There can sometimes be multiple commands per target (e.g. ar+ranlib).
|
||||
# We must collect these together to output a single Ninja rule.
|
||||
if node not in node_map:
|
||||
node_list.append(node)
|
||||
node_map.setdefault(node, []).append(cmd)
|
||||
for e in envs:
|
||||
e.Append(PRINT_CMD_LINE_FUNC=CustomCommandPrinter)
|
||||
def WriteFile():
|
||||
|
||||
Reference in New Issue
Block a user