1#!/usr/bin/env python3 2 3import os 4import sys 5import shutil 6 7arg_path=os.path.join(os.path.abspath(os.path.dirname(os.getcwd())),'script') 8sys.path.append(arg_path) 9 10from config_args import linux_args 11 12def build(): 13 if os.path.exists("build") and os.path.isdir("build"): 14 shutil.rmtree("build") 15 while True: 16 if not os.path.exists("build"): 17 break 18 os.mkdir("build") 19 os.chdir("build") 20 build_cmd = "cmake -G 'Ninja' " + (" ".join(linux_args))+ " .." 21 print(build_cmd) 22 os.system(build_cmd) 23 os.system("ninja -f build.ninja") 24 # os.chdir(os.path.abspath(os.path.dirname(os.getcwd()))) 25 # if os.path.exists("build") and os.path.isdir("build"): 26 # shutil.rmtree("build") 27 28 29if __name__ == '__main__': 30 build() 31 32 33