Compare commits
10 Commits
896836b1e3
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 2df5079392 | |||
| fbf33992e3 | |||
| 735d6a60ee | |||
| ae0cef0ac6 | |||
| c81f3aba78 | |||
| ccba298c55 | |||
| e57c89f561 | |||
| c7ceb1bc99 | |||
| c9eb3bdeba | |||
| 898bed99e4 |
@@ -10,21 +10,22 @@ ifeq (${OS},Windows_NT)
|
|||||||
SHELL := powershell.exe
|
SHELL := powershell.exe
|
||||||
.SHELLFLAGS := -NoProfile -Command
|
.SHELLFLAGS := -NoProfile -Command
|
||||||
BC_VAR_OS=windows
|
BC_VAR_OS=windows
|
||||||
|
BC_CMD_HOST_PY3=python
|
||||||
else
|
else
|
||||||
BC_VAR_OS=$(shell uname | tr [:upper:] [:lower:])
|
BC_VAR_OS=$(shell uname | tr [:upper:] [:lower:])
|
||||||
endif
|
ifneq ($(shell which python3 2> /dev/null),)
|
||||||
|
BC_CMD_HOST_PY3=python3
|
||||||
ifneq ($(shell which python3 2> /dev/null),)
|
|
||||||
BC_CMD_HOST_PY3=python3
|
|
||||||
else
|
|
||||||
ifeq ($(shell python -c 'import sys; print(sys.version_info[0])'),3)
|
|
||||||
BC_CMD_HOST_PY3=python
|
|
||||||
else
|
else
|
||||||
echo 'Please install Python3 on host'
|
ifeq ($(shell python -c 'import sys; print(sys.version_info[0])'),3)
|
||||||
exit 1
|
BC_CMD_HOST_PY3=python
|
||||||
|
else
|
||||||
|
echo 'Please install Python3 on host'
|
||||||
|
exit 1
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
ifdef BC_VAR_USE_DOCKER_DEVENV
|
ifdef BC_VAR_USE_DOCKER_DEVENV
|
||||||
ifneq ($(shell which docker 2> /dev/null),)
|
ifneq ($(shell which docker 2> /dev/null),)
|
||||||
BC_VAR_DEVENV=devenv$(shell pwd | sed 's/\//-/g')
|
BC_VAR_DEVENV=devenv$(shell pwd | sed 's/\//-/g')
|
||||||
@@ -43,6 +44,9 @@ ifdef BC_VAR_USE_DOCKER_DEVENV
|
|||||||
exit 1
|
exit 1
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
ifndef BC_VAR_DEVENV_ROOT
|
||||||
|
BC_VAR_DEVENV_ROOT="."
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
BC_CMD_PY3=${BC_CMD_HOST_PY3}
|
BC_CMD_PY3=${BC_CMD_HOST_PY3}
|
||||||
endif
|
endif
|
||||||
@@ -89,7 +93,7 @@ purge:
|
|||||||
${BC_CMD_RM_RF} compile_commands.json
|
${BC_CMD_RM_RF} compile_commands.json
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test: build
|
test: build
|
||||||
${BC_CMD_ENVRUN} python3 -m mypy ${BC_VAR_SCRIPTS}
|
${BC_CMD_ENVRUN} ${BC_CMD_PY3} -m mypy ${BC_VAR_SCRIPTS}
|
||||||
${BC_CMD_CMAKE_BUILD} ${BC_VAR_BUILD_PATH} test
|
${BC_CMD_CMAKE_BUILD} ${BC_VAR_BUILD_PATH} test
|
||||||
.PHONY: test-verbose
|
.PHONY: test-verbose
|
||||||
test-verbose: build
|
test-verbose: build
|
||||||
@@ -101,7 +105,7 @@ test-rerun-verbose: build
|
|||||||
ifdef BC_VAR_USE_DOCKER_DEVENV
|
ifdef BC_VAR_USE_DOCKER_DEVENV
|
||||||
.PHONY: devenv-image
|
.PHONY: devenv-image
|
||||||
devenv-image:
|
devenv-image:
|
||||||
docker build . -t ${BC_VAR_DEVENV_IMAGE}
|
docker build ${BC_VAR_DEVENV_ROOT} -t ${BC_VAR_DEVENV_IMAGE}
|
||||||
.PHONY: devenv-create
|
.PHONY: devenv-create
|
||||||
devenv-create:
|
devenv-create:
|
||||||
docker run -d \
|
docker run -d \
|
||||||
|
|||||||
+9
-1
@@ -11,6 +11,7 @@
|
|||||||
# "Python Busy Box" - adds cross-platform equivalents to Unix commands that
|
# "Python Busy Box" - adds cross-platform equivalents to Unix commands that
|
||||||
# don't translate well to that other operating system
|
# don't translate well to that other operating system
|
||||||
|
|
||||||
|
import multiprocessing
|
||||||
import os
|
import os
|
||||||
import platform
|
import platform
|
||||||
import shutil
|
import shutil
|
||||||
@@ -57,7 +58,11 @@ def cmake_build(base_path: str, target: Optional[str]) -> int:
|
|||||||
path = os.path.join(base_path, d)
|
path = os.path.join(base_path, d)
|
||||||
if not os.path.isdir(path):
|
if not os.path.isdir(path):
|
||||||
continue
|
continue
|
||||||
args = ['cmake', '--build', path]
|
args = ['cmake', '--build', path, f'-j{multiprocessing.cpu_count()}']
|
||||||
|
if path.endswith('release'):
|
||||||
|
args.append('--config=release')
|
||||||
|
elif path.endswith('debug'):
|
||||||
|
args.append('--config=debug')
|
||||||
if target is not None:
|
if target is not None:
|
||||||
args.extend(['--target', target])
|
args.extend(['--target', target])
|
||||||
err = subprocess.run(args).returncode
|
err = subprocess.run(args).returncode
|
||||||
@@ -98,6 +103,9 @@ def debug(paths: List[str]) -> int:
|
|||||||
args = ['gdb', '--args']
|
args = ['gdb', '--args']
|
||||||
elif shutil.which('lldb') is not None:
|
elif shutil.which('lldb') is not None:
|
||||||
args = ['lldb', '--']
|
args = ['lldb', '--']
|
||||||
|
else:
|
||||||
|
sys.stderr.write('debug: could not find a supported debugger\n')
|
||||||
|
return 1
|
||||||
args.extend(paths)
|
args.extend(paths)
|
||||||
return subprocess.run(args).returncode
|
return subprocess.run(args).returncode
|
||||||
|
|
||||||
|
|||||||
@@ -96,10 +96,12 @@ def main() -> int:
|
|||||||
cmake_cmd.append(build_tool)
|
cmake_cmd.append(build_tool)
|
||||||
if qt_path != '':
|
if qt_path != '':
|
||||||
cmake_cmd.append(qt_path)
|
cmake_cmd.append(qt_path)
|
||||||
if platform.system() == 'Windows':
|
if platform.system() == 'Windows' and platform.system() == 'AMD64':
|
||||||
cmake_cmd.append('-A x64')
|
cmake_cmd.append('-A x64')
|
||||||
|
|
||||||
subprocess.run(cmake_cmd)
|
cmake_err = subprocess.run(cmake_cmd).returncode
|
||||||
|
if cmake_err != 0:
|
||||||
|
return cmake_err
|
||||||
|
|
||||||
util.mkdir_p('dist')
|
util.mkdir_p('dist')
|
||||||
if int(args.current_build) != 0:
|
if int(args.current_build) != 0:
|
||||||
|
|||||||
+4
-2
@@ -32,7 +32,9 @@ def get_os() -> str:
|
|||||||
|
|
||||||
|
|
||||||
def get_arch() -> str:
|
def get_arch() -> str:
|
||||||
arch = platform.machine()
|
arch = platform.machine().lower()
|
||||||
if arch.lower() == 'amd64':
|
if arch == 'amd64':
|
||||||
arch = 'x86_64'
|
arch = 'x86_64'
|
||||||
|
elif arch == 'aarch64':
|
||||||
|
arch = 'arm64'
|
||||||
return arch
|
return arch
|
||||||
|
|||||||
Reference in New Issue
Block a user