pymake

A build system based on Build Systems à la Carte
git clone https://git.grace.moe/pymake
Log | Files | Refs | README

commit 49686f32e26929787833cdaf3d7e5e70efa997d4
parent 906d33d40421e70fa9d77d2b9d6a7d55d1745698
Author: gracefu <81774659+gracefuu@users.noreply.github.com>
Date:   Sat, 19 Apr 2025 23:57:03 +0800

add async version of main

Diffstat:
Mmake/__init__.py | 10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/make/__init__.py b/make/__init__.py @@ -529,6 +529,16 @@ def run_in_executor(f, *args, executor=None): return asyncio.get_running_loop().run_in_executor(executor, f, *args) +async def async_main(globals, filename=".makedb", default_target="all"): + targets = sys.argv[1:] + if not targets: + targets.append(default_target) + + with Build(filename) as build: + await build(*(eval(target, globals=globals) for target in targets)) + return 0 + + def main(globals, filename=".makedb", default_target="all"): targets = sys.argv[1:] if not targets: