[tools/link-order] Sort objects so that compilation can be done in a fixed link order.

This commit is contained in:
childerxxx 2022-09-10 15:05:35 +08:00 committed by guo
parent ffe1c57240
commit 5e3622402d
1 changed files with 9 additions and 1 deletions

View File

@ -775,8 +775,16 @@ def DoBuilding(target, objects):
objects.remove(obj) objects.remove(obj)
# re-add the source files to the objects # re-add the source files to the objects
objects_in_group = []
for group in Projects: for group in Projects:
local_group(group, objects) local_group(group, objects_in_group)
# sort seperately, because the data type of
# the members of the two lists are different
objects_in_group = sorted(objects_in_group)
objects = sorted(objects)
objects.append(objects_in_group)
program = Env.Program(target, objects) program = Env.Program(target, objects)