diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/build.py | 29 | ||||
-rw-r--r-- | tools/cppmerge/.vscode/launch.json | 20 |
2 files changed, 29 insertions, 20 deletions
diff --git a/tools/build.py b/tools/build.py new file mode 100644 index 00000000..009b3aad --- /dev/null +++ b/tools/build.py @@ -0,0 +1,29 @@ +import argparse +import os +import os.path +import subprocess +import sys + +parser = argparse.ArgumentParser() +parser.add_argument('-a', '--arch', choices=['x86', 'x64'], + required=True, help='specify target cpu architecture') +parser.add_argument('-c', '--config', choices=['Debug', 'Release'], + required=True, help='specify build configuration') +args = parser.parse_args() + + +project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) +os.chdir(project_root) + +os.environ['PreferredToolArchitecture'] = 'x64' # use x64 toolchain + +generater_vs_arch_map = { + 'x86': 'Win32', + 'x64': 'x64' +} + +subprocess.run('cmake -S . -B build -G "Visual Studio 15 2017" -A {arch}'.format(arch=generater_vs_arch_map[args.arch]), + stdout=sys.stdout, stderr=sys.stderr) + +subprocess.run('cmake --build build --target ALL_BUILD --config {config}'.format(config=args.config), + stdout=sys.stdout, stderr=sys.stderr) diff --git a/tools/cppmerge/.vscode/launch.json b/tools/cppmerge/.vscode/launch.json deleted file mode 100644 index dcbc3389..00000000 --- a/tools/cppmerge/.vscode/launch.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Python", - "type": "python", - "request": "launch", - "program": "${workspaceFolder}/main.py", - "args": [ - "--output", - "cru_ui", - "../../src" - ], - "console": "integratedTerminal" - } - ] -}
\ No newline at end of file |