install.py 579 Bytes
Newer Older
1
2
3
4
import os
import subprocess
import platform
import sys
PanZezhong's avatar
PanZezhong committed
5
from set_env import set_env
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

PROJECT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
os.chdir(PROJECT_DIR)

def run_cmd(cmd):
    subprocess.run(cmd, text=True, encoding="utf-8", check=True, shell=True)


def install(xmake_config_flags=""):
    run_cmd(f"xmake f {xmake_config_flags} -cv")
    run_cmd("xmake")
    run_cmd("xmake install")
    run_cmd("xmake build infiniop-test")
    run_cmd("xmake install infiniop-test")


if __name__ == "__main__":
    set_env()
    install(" ".join(sys.argv[1:]))