MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / calculate

Function calculate

tools/system_libs.py:2471–2495  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

2469
2470
2471def calculate(options):
2472 libs_to_link = get_libs_to_link(options)
2473
2474 # When LINKABLE is set the entire link command line is wrapped in --whole-archive by
2475 # building.link_ldd. And since --whole-archive/--no-whole-archive processing does not nest we
2476 # shouldn't add any extra `--no-whole-archive` or we will undo the intent of building.link_ldd.
2477 if settings.LINKABLE or settings.SIDE_MODULE:
2478 return [l[0] for l in libs_to_link]
2479
2480 # Wrap libraries in --whole-archive, as needed. We need to do this last
2481 # since otherwise the abort sorting won't make sense.
2482 ret = []
2483 in_group = False
2484 for name, need_whole_archive in libs_to_link:
2485 if need_whole_archive and not in_group:
2486 ret.append('--whole-archive')
2487 in_group = True
2488 if in_group and not need_whole_archive:
2489 ret.append('--no-whole-archive')
2490 in_group = False
2491 ret.append(name)
2492 if in_group:
2493 ret.append('--no-whole-archive')
2494
2495 return ret
2496
2497
2498def safe_copytree(src, dst, excludes=None):

Callers

nothing calls this directly

Calls 2

get_libs_to_linkFunction · 0.85
appendMethod · 0.80

Tested by

no test coverage detected