Compare commits

...

2 Commits

2 changed files with 11 additions and 4 deletions

View File

@ -83,9 +83,6 @@ def install_lib(lib, src_dir, work_dir, inst_dir, comp_cc, comp_cxx, comp_fc, bu
finished = False finished = False
while build_task.poll() is None: while build_task.poll() is None:
if not finished: if not finished:
# bar_width = num_objects
# while (bar_width > 100):
# bar_width = int(bar_width/10)
bar_width = 50 bar_width = 50
for i in progressbar(range(num_objects), "Building library: ", bar_width): for i in progressbar(range(num_objects), "Building library: ", bar_width):
while len(glob.glob('**/*.o', recursive=True)) < i: while len(glob.glob('**/*.o', recursive=True)) < i:

View File

@ -25,14 +25,24 @@ def sort_libs_by_dependencies(selected_libs):
if len(selected_libs) < 2: if len(selected_libs) < 2:
return selected_libs return selected_libs
lib_names = []
for lib in selected_libs:
lib_names.append(lib['name'])
deplist = [] deplist = []
for lib in selected_libs: for lib in selected_libs:
name = lib['name'] name = lib['name']
dependencies = set(lib['dependencies'].split(',')) # only sort after dependencies that are actually present to avoid cyclic dependencies
deps = []
for dep in lib['dependencies'].split(','):
if dep in lib_names:
deps.append(dep)
dependencies = set(deps)
if dependencies == {''}: if dependencies == {''}:
dependencies = {} dependencies = {}
deplist.append([name, dependencies]) deplist.append([name, dependencies])
sorted_deplist = topological_sort(deplist) sorted_deplist = topological_sort(deplist)
sorted = [] sorted = []
for entry in sorted_deplist: for entry in sorted_deplist:
for lib in selected_libs: for lib in selected_libs: