build: use Zig via ziglang PyPI package

This avoids cluttering workdir with unpacked tarball
and will work automatically once PEP-723 is implemented.
This commit is contained in:
link2xt
2023-10-22 08:46:37 +00:00
parent c13bbd05cd
commit b4fe9e3eec
2 changed files with 18 additions and 10 deletions

View File

@@ -1,7 +1,13 @@
#!/usr/bin/env python
# /// pyproject
# [run]
# dependencies = [
# "ziglang==0.11.0"
# ]
# ///
import os
import subprocess
import sys
import os
def flag_filter(flag: str) -> bool:
@@ -34,7 +40,17 @@ def main():
args += ["-DBROKEN_CLANG_ATOMICS"]
subprocess.run(
["zig", "cc", "-target", zig_target, *zig_cpu_args, *args], check=True
[
sys.executable,
"-m",
"ziglang",
"cc",
"-target",
zig_target,
*zig_cpu_args,
*args,
],
check=True,
)