aboutsummaryrefslogtreecommitdiff
path: root/tools/win_build.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/win_build.py')
-rw-r--r--tools/win_build.py33
1 files changed, 14 insertions, 19 deletions
diff --git a/tools/win_build.py b/tools/win_build.py
index 7332af77..6cb079b4 100644
--- a/tools/win_build.py
+++ b/tools/win_build.py
@@ -22,11 +22,7 @@ args = parser.parse_args()
project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
work_dir = os.path.join(project_root, args.work_dir)
-try:
- vcpkg_root = os.environ.get('VCPKG_INSTALLATION_ROOT')
-except:
- print('Failed to find vcpkg installation root by environment variable.')
- exit(1)
+vcpkg_root = os.path.join(project_root, 'vcpkg')
cmake_toolchain_path = os.path.join(
vcpkg_root, 'scripts/buildsystems/vcpkg.cmake')
@@ -34,22 +30,21 @@ cmake_toolchain_path = os.path.join(
# this is not used when generator is Visual Studio
-def init_vc_environment(arch):
- arch_bat_map = {
- 'x86': 'vcvarsamd64_x86',
- 'x64': 'vcvars64'
- }
- vars = subprocess.check_output(['C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Auxiliary\\Build\\{}'.format(
- arch_bat_map[arch]), '&&', 'set'], shell=True, text=True)
- for var in vars.splitlines():
- k, _, v = map(str.strip, var.strip().partition('='))
- if k.startswith('?'):
- continue
- os.environ[k] = v
-
+# def init_vc_environment(arch):
+# arch_bat_map = {
+# 'x86': 'vcvarsamd64_x86',
+# 'x64': 'vcvars64'
+# }
+# vars = subprocess.check_output(['C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Auxiliary\\Build\\{}'.format(
+# arch_bat_map[arch]), '&&', 'set'], shell=True, text=True)
+# for var in vars.splitlines():
+# k, _, v = map(str.strip, var.strip().partition('='))
+# if k.startswith('?'):
+# continue
+# os.environ[k] = v
def install_packages():
- subprocess.check_call('vcpkg install gtest:{arch}-windows fmt:{arch}-windows ms-gsl:{arch}-windows'.format(arch=args.arch),
+ subprocess.check_call('vcpkg\\vcpkg.exe install gtest:{arch}-windows fmt:{arch}-windows ms-gsl:{arch}-windows'.format(arch=args.arch),
stdout=sys.stdout, stderr=sys.stderr)