[buildcore] Update buildcore
This commit is contained in:
12
deps/buildcore/scripts/setup-build.py
vendored
12
deps/buildcore/scripts/setup-build.py
vendored
@ -15,9 +15,7 @@ import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
from pybb import mkdir, rm
|
||||
|
||||
os_name = os.uname().sysname.lower()
|
||||
import util
|
||||
|
||||
|
||||
def main() -> int:
|
||||
@ -25,7 +23,7 @@ def main() -> int:
|
||||
parser.add_argument(
|
||||
'--target',
|
||||
help='Platform target',
|
||||
default=f'{os_name}-{platform.machine()}')
|
||||
default=f'{util.get_os()}-{util.get_arch()}')
|
||||
parser.add_argument(
|
||||
'--build_type',
|
||||
help='Build type (asan,debug,release)',
|
||||
@ -84,7 +82,7 @@ def main() -> int:
|
||||
|
||||
project_dir = os.getcwd()
|
||||
build_dir = f'{project_dir}/{args.build_root}/{build_config}'
|
||||
rm(build_dir)
|
||||
util.rm(build_dir)
|
||||
cmake_cmd = [
|
||||
'cmake', '-S', project_dir, '-B', build_dir, build_tool,
|
||||
'-DCMAKE_EXPORT_COMPILE_COMMANDS=ON',
|
||||
@ -101,13 +99,13 @@ def main() -> int:
|
||||
|
||||
subprocess.run(cmake_cmd)
|
||||
|
||||
mkdir('dist')
|
||||
util.mkdir_p('dist')
|
||||
if int(args.current_build) != 0:
|
||||
cb = open('.current_build', 'w')
|
||||
cb.write(args.build_type)
|
||||
cb.close()
|
||||
|
||||
rm('compile_commands.json')
|
||||
util.rm('compile_commands.json')
|
||||
if platform.system() != 'Windows':
|
||||
os.symlink(f'{build_dir}/compile_commands.json',
|
||||
'compile_commands.json')
|
||||
|
Reference in New Issue
Block a user