]>
Witch of Git - ivy/blob - tools/run.py
6 from pathlib
import Path
8 root
= Path(__file__
).parent
.parent
9 ivy
= root
/ "target" / "release" / "ivy"
10 library_path
= root
/ "rt" / "target" / "release"
13 def compile(source
, output
):
15 [ivy
, source
, "-o", output
],
16 env
={"LIBRARY_PATH": library_path
},
21 def run(script
, only_debug
=True):
22 with tempfile
.TemporaryDirectory() as d
:
23 binary
= Path(d
) / "a.out"
24 compile(script
, output
=binary
)
25 trace
.trace(binary
, only_debug
)
29 parser
= argparse
.ArgumentParser()
30 parser
.add_argument("script")
31 parser
.add_argument("-v", "--verbose", action
="store_true")
32 args
= parser
.parse_args()
33 run(args
.script
, not args
.verbose
)
36 if __name__
== "__main__":