25 """Get the location of msdia*.dll for the platform."""
26
27
28 DIA_DLL = {
29 '2013': 'msdia120.dll',
30 '2015': 'msdia140.dll',
31 '2017': 'msdia140.dll',
32 '2019': 'msdia140.dll',
33 '2022': 'msdia140.dll',
34 }
35
36
37 environ_bak = os.environ
38
39 sys.path.append(os.path.join(THIS_DIR, '..', '..', 'build'))
40 import vs_toolchain
43
44 if bool(
int(os.environ.get(
'DEPOT_TOOLS_WIN_TOOLCHAIN',
'1'))):
45
46
47
48
49
50 dia_path = os.path.join(win_sdk_dir, '..', '..', 'DIA SDK', 'bin', 'amd64')
51 else:
52 if 'GYP_MSVS_OVERRIDE_PATH' in os.environ:
53 vs_path = os.environ['GYP_MSVS_OVERRIDE_PATH']
54 else:
56 dia_path = os.path.join(vs_path, 'DIA SDK', 'bin', 'amd64')
57
58 os.environ = environ_bak
59 return os.path.join(dia_path, DIA_DLL[msvs_version])
60
61