MCPcopy Index your code
hub / github.com/pymupdf/PyMuPDF / base_linker

Function base_linker

pipcl.py:2021–2062  ·  view source on GitHub ↗

Returns basic linker command. Args: vs: Windows only. A `wdev.WindowsVS` instance or None to use default `wdev.WindowsVS` instance. pythonflags: A `pipcl.PythonFlags` instance or None to use default `pipcl.PythonFlags` instanc

(vs=None, pythonflags=None, cpp=False, use_env=True)

Source from the content-addressed store, hash-verified

2019
2020
2021def base_linker(vs=None, pythonflags=None, cpp=False, use_env=True):
2022 '''
2023 Returns basic linker command.
2024
2025 Args:
2026 vs:
2027 Windows only. A `wdev.WindowsVS` instance or None to use default
2028 `wdev.WindowsVS` instance.
2029 pythonflags:
2030 A `pipcl.PythonFlags` instance or None to use default
2031 `pipcl.PythonFlags` instance.
2032 cpp:
2033 If true we return C++ linker command instead of C. On Windows this
2034 has no effect - we always return `link.exe`.
2035 use_env:
2036 If true we use `os.environ['LD']` if set.
2037
2038 Returns `(linker, pythonflags)`:
2039 linker:
2040 Linker command. On Windows this is of the form
2041 `{vs.vcvars}&&{vs.link}`; otherwise it is typically `cc` or `c++`.
2042 pythonflags:
2043 The `pythonflags` arg or a new `pipcl.PythonFlags` instance.
2044 '''
2045 if not pythonflags:
2046 pythonflags = PythonFlags()
2047 linker = None
2048 if use_env:
2049 if os.environ.get( 'LD'):
2050 linker = '$LD'
2051 if linker:
2052 pass
2053 elif windows():
2054 if not vs:
2055 vs = wdev.WindowsVS()
2056 linker = f'"{vs.vcvars}"&&"{vs.link}"'
2057 elif wasm():
2058 linker = 'em++' if cpp else 'emcc'
2059 else:
2060 linker = 'c++' if cpp else 'cc'
2061 linker = macos_add_cross_flags( linker)
2062 return linker, pythonflags
2063
2064
2065def git_info( directory):

Callers 1

build_extensionFunction · 0.85

Calls 5

PythonFlagsClass · 0.85
windowsFunction · 0.85
wasmFunction · 0.85
macos_add_cross_flagsFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…