8This script is based on chromium/chromium/main/tools/clang/scripts/update.py.
10It is used on Windows platforms to copy the correct msdia*.dll to the
11clang folder, as a "gclient hook".
20THIS_DIR = os.path.abspath(os.path.dirname(__file__))
21LLVM_BUILD_DIR = os.path.abspath(os.path.join(THIS_DIR,
'..',
'buildtools',
'windows-x64',
'clang'))
25 """Get the location of msdia*.dll for the platform."""
29 '2013':
'msdia120.dll',
30 '2015':
'msdia140.dll',
31 '2017':
'msdia140.dll',
32 '2019':
'msdia140.dll',
33 '2022':
'msdia140.dll',
37 environ_bak = os.environ
39 sys.path.append(os.path.join(THIS_DIR,
'..',
'..',
'build'))
44 if bool(
int(os.environ.get(
'DEPOT_TOOLS_WIN_TOOLCHAIN',
'1'))):
50 dia_path = os.path.join(win_sdk_dir,
'..',
'..',
'DIA SDK',
'bin',
'amd64')
52 if 'GYP_MSVS_OVERRIDE_PATH' in os.environ:
53 vs_path = os.environ[
'GYP_MSVS_OVERRIDE_PATH']
56 dia_path = os.path.join(vs_path,
'DIA SDK',
'bin',
'amd64')
58 os.environ = environ_bak
59 return os.path.join(dia_path, DIA_DLL[msvs_version])
63 """Copy a file from src to dst."""
64 print(
"Copying %s to %s" % (str(src), str(dst)))
79if __name__ ==
'__main__':
def CopyDiaDllTo(target_dir)
def print(*args, **kwargs)