Detect platform and architecture without importing clang_tool_chain.
()
| 44 | |
| 45 | |
| 46 | def _get_platform_info() -> tuple[str, str]: |
| 47 | """Detect platform and architecture without importing clang_tool_chain.""" |
| 48 | system = platform.system().lower() |
| 49 | machine = platform.machine().lower() |
| 50 | |
| 51 | if system == "windows": |
| 52 | platform_name = "win" |
| 53 | elif system == "linux": |
| 54 | platform_name = "linux" |
| 55 | elif system == "darwin": |
| 56 | platform_name = "darwin" |
| 57 | else: |
| 58 | raise RuntimeError(f"Unsupported platform: {system}") |
| 59 | |
| 60 | if machine in ("x86_64", "amd64"): |
| 61 | arch = "x86_64" |
| 62 | elif machine in ("arm64", "aarch64"): |
| 63 | arch = "arm64" |
| 64 | else: |
| 65 | raise RuntimeError(f"Unsupported architecture: {machine}") |
| 66 | |
| 67 | return platform_name, arch |
| 68 | |
| 69 | |
| 70 | def setup_emscripten_env() -> bool: |
no outgoing calls
no test coverage detected