MCPcopy Create free account
hub / github.com/bshoshany/thread-pool / get_llvm_std_module

Function get_llvm_std_module

scripts/compile_cpp.py:191–200  ·  view source on GitHub ↗

Get the path to the LLVM standard library module on Linux or macOS. If multiple paths are found, return the one with the latest LLVM version.

(search: str)

Source from the content-addressed store, hash-verified

189
190
191def get_llvm_std_module(search: str) -> str | None:
192 """Get the path to the LLVM standard library module on Linux or macOS. If multiple paths are found, return the one with the latest LLVM version."""
193 try:
194 llvm_path: str = subprocess.check_output([f"find {search} -name std.cppm"], text=True, shell=True).strip()
195 except subprocess.CalledProcessError:
196 llvm_path: str = ""
197 all_paths: list[str] = [line for line in llvm_path.splitlines() if line.strip()]
198 if len(all_paths) == 0:
199 return None
200 return max(all_paths, key=lambda p: parse_llvm_version(p) or (0,))
201
202
203def find_vs_path() -> pathlib.Path | None:

Callers 1

compile_cpp.pyFile · 0.85

Calls 1

parse_llvm_versionFunction · 0.85

Tested by

no test coverage detected