MCPcopy
hub / github.com/astral-sh/python-build-standalone / link_for_target

Function link_for_target

pythonbuild/cpython.py:214–226  ·  view source on GitHub ↗
(lib: str, target_triple: str)

Source from the content-addressed store, hash-verified

212
213
214def link_for_target(lib: str, target_triple: str) -> str:
215 # TODO use -Wl,-hidden-lbz2?
216 # TODO use -Wl,--exclude-libs,libfoo.a?
217
218 if "-apple-" in target_triple:
219 # The -l:filename syntax doesn't appear to work on Apple.
220 # just give the library name and hope it turns out OK.
221 if lib.startswith(":lib") and lib.endswith(".a"):
222 return f"-Xlinker -hidden-l{lib[4:-2]}"
223 else:
224 return f"-Xlinker -hidden-l{lib}"
225 else:
226 return f"-l{lib}"
227
228
229def meets_python_minimum_version(got: str, wanted: str) -> bool:

Callers 1

derive_setup_localFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected