-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexecompile.py
More file actions
38 lines (27 loc) · 800 Bytes
/
execompile.py
File metadata and controls
38 lines (27 loc) · 800 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import os
import shutil
import subprocess
is_windows = os.name == "nt"
def build_rust(build_args, out_name):
print("Building", out_name)
subprocess.run(
["cargo", "build", "--release"] + build_args,
cwd="bootloader",
check=True,
)
exe_name = "bootloader" + (".exe" if is_windows else "")
src = os.path.join(
"bootloader",
"target",
"release",
exe_name,
)
dst = os.path.join('EXEs', out_name + (".exe" if is_windows else ""))
shutil.copy2(src, dst)
def main():
#shutil.rmtree('EXEs', ignore_errors=True)
os.makedirs('EXEs', exist_ok=True)
build_rust(["--features", "console"], "bootloader")
build_rust(["--no-default-features"], "bootloaderw")
if __name__ == "__main__":
main()