diff options
author | crupest <crupest@outlook.com> | 2020-07-01 18:37:53 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-07-01 18:37:53 +0800 |
commit | f451394b9093073d401d5f78f1b7d6ca16605fe2 (patch) | |
tree | e4ee270838784e3356976107505ded1b1e46d18d /tools/win_build.py | |
parent | db47dcb39c2753e1ea3b83856ce5f2badffba90f (diff) | |
download | cru-f451394b9093073d401d5f78f1b7d6ca16605fe2.tar.gz cru-f451394b9093073d401d5f78f1b7d6ca16605fe2.tar.bz2 cru-f451394b9093073d401d5f78f1b7d6ca16605fe2.zip |
...
Diffstat (limited to 'tools/win_build.py')
-rw-r--r-- | tools/win_build.py | 33 |
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) |