]>
Witch of Git - ivy/blob - tools/run.py
5 from pathlib
import Path
10 root
= Path(__file__
).parent
.parent
11 ivy
= root
/ 'target' / 'release' / 'ivy'
12 library_path
= root
/ 'rt' / 'target' / 'release'
15 def compile(source
, output
):
17 [ivy
, source
, '-o', output
],
18 env
={'LIBRARY_PATH': library_path
},
23 def run(script
, only_debug
=True):
24 with tempfile
.TemporaryDirectory() as d
:
25 binary
= Path(d
) / 'a.out'
26 compile(script
, output
=binary
)
27 trace
.trace(binary
, only_debug
)
31 parser
= argparse
.ArgumentParser()
32 parser
.add_argument('script')
33 parser
.add_argument('-v', '--verbose', action
='store_true')
34 args
= parser
.parse_args()
35 run(args
.script
, not args
.verbose
)
38 if __name__
== '__main__':