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

Method get_link_flag

tools/system_libs.py:445–456  ·  view source on GitHub ↗

Get the link flags needed to use the library. This will trigger a build if this library is not in the cache.

(self)

Source from the content-addressed store, hash-verified

443 return cache.get(self.get_path(), self.do_generate, force=USE_NINJA == 2, quiet=USE_NINJA)
444
445 def get_link_flag(self):
446 """Get the link flags needed to use the library.
447
448 This will trigger a build if this library is not in the cache.
449 """
450 fullpath = self.build()
451 # For non-libraries (e.g. crt1.o) we pass the entire path to the linker
452 if self.get_ext() != '.a':
453 return fullpath
454 # For libraries (.a) files, we pass the abbreviated `-l` form.
455 base = utils.unsuffixed_basename(fullpath)
456 return '-l' + base.removeprefix('lib')
457
458 def get_files(self):
459 """Get a list of source files for this library.

Callers 2

process_librariesFunction · 0.80
add_libraryFunction · 0.80

Calls 2

buildMethod · 0.95
get_extMethod · 0.95

Tested by

no test coverage detected