IASON
This commit is contained in:
10
cent
10
cent
@@ -53,17 +53,19 @@ def main():
|
||||
sys.exit(f"CENTVRION error: {e}")
|
||||
else:
|
||||
c_source = compile_program(program)
|
||||
runtime_c = os.path.join(
|
||||
runtime_dir = os.path.join(
|
||||
os.path.dirname(__file__),
|
||||
"centvrion", "compiler", "runtime", "cent_runtime.c"
|
||||
"centvrion", "compiler", "runtime"
|
||||
)
|
||||
runtime_c = os.path.join(runtime_dir, "cent_runtime.c")
|
||||
iason_c = os.path.join(runtime_dir, "cent_iason.c")
|
||||
out_path = os.path.splitext(file_path)[0]
|
||||
if args["--keep-c"]:
|
||||
tmp_path = out_path + ".c"
|
||||
with open(tmp_path, "w") as f:
|
||||
f.write(c_source)
|
||||
subprocess.run(
|
||||
["gcc", "-O2", tmp_path, runtime_c, "-o", out_path, "-lcurl", "-lmicrohttpd"],
|
||||
["gcc", "-O2", tmp_path, runtime_c, iason_c, "-o", out_path, "-lcurl", "-lmicrohttpd", "-lm"],
|
||||
check=True,
|
||||
)
|
||||
else:
|
||||
@@ -72,7 +74,7 @@ def main():
|
||||
tmp_path = tmp.name
|
||||
try:
|
||||
subprocess.run(
|
||||
["gcc", "-O2", tmp_path, runtime_c, "-o", out_path, "-lcurl", "-lmicrohttpd"],
|
||||
["gcc", "-O2", tmp_path, runtime_c, iason_c, "-o", out_path, "-lcurl", "-lmicrohttpd", "-lm"],
|
||||
check=True,
|
||||
)
|
||||
finally:
|
||||
|
||||
Reference in New Issue
Block a user