MCPcopy Create free account
hub / github.com/ClangBuiltLinux/tc-build / from_env

Method from_env

tc_build/tools.py:150–160  ·  view source on GitHub ↗
(self, key: str)

Source from the content-addressed store, hash-verified

148 return tc_build.utils.UNINIT_PATH
149
150 def from_env(self, key: str) -> Path:
151 if key not in os.environ:
152 return tc_build.utils.UNINIT_PATH
153
154 if key == 'LD':
155 return self.validate_ld(os.environ[key], warn=True)
156
157 if not (tool := shutil.which(os.environ[key])):
158 msg = f"{key} value ('{os.environ[key]}') could not be found on your system?"
159 raise RuntimeError(msg)
160 return Path(tool)
161
162 def show_compiler_linker(self) -> None:
163 print(f"CC: {self.cc}")

Callers 3

find_host_ccMethod · 0.95
find_host_cxxMethod · 0.95
find_host_ldMethod · 0.95

Calls 1

validate_ldMethod · 0.95

Tested by

no test coverage detected