Commit 75fb92d6 authored by Hans Wennborg's avatar Hans Wennborg Committed by Commit Bot

Clang update.py: Try to find DIA dll correctly when not using the depot_tools win toolchain

The DIA SDK normally lives in the Visual Studio installation dir.

Bug: none
Change-Id: I38c17fdc6e26a49eb4205aceb34e56e7be9d3a65
Reviewed-on: https://chromium-review.googlesource.com/1106138Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Commit-Queue: Hans Wennborg <hans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568477}
parent d5a28e18
...@@ -80,12 +80,6 @@ LLVM_REPO_URL='https://llvm.org/svn/llvm-project' ...@@ -80,12 +80,6 @@ LLVM_REPO_URL='https://llvm.org/svn/llvm-project'
if 'LLVM_REPO_URL' in os.environ: if 'LLVM_REPO_URL' in os.environ:
LLVM_REPO_URL = os.environ['LLVM_REPO_URL'] LLVM_REPO_URL = os.environ['LLVM_REPO_URL']
# Bump after VC updates.
DIA_DLL = {
'2013': 'msdia120.dll',
'2015': 'msdia140.dll',
'2017': 'msdia140.dll',
}
def DownloadUrl(url, output_file): def DownloadUrl(url, output_file):
...@@ -372,14 +366,21 @@ def AddGnuWinToPath(): ...@@ -372,14 +366,21 @@ def AddGnuWinToPath():
win_sdk_dir = None win_sdk_dir = None
msvs_version = None dia_dll = None
def GetWinSDKDir(): def GetWinSDKDir():
"""Get the location of the current SDK. Sets msvs_version as a side-effect.""" """Get the location of the current SDK. Sets dia_dll as a side-effect."""
global win_sdk_dir global win_sdk_dir
global msvs_version global dia_dll
if win_sdk_dir: if win_sdk_dir:
return win_sdk_dir return win_sdk_dir
# Bump after VC updates.
DIA_DLL = {
'2013': 'msdia120.dll',
'2015': 'msdia140.dll',
'2017': 'msdia140.dll',
}
# Don't let vs_toolchain overwrite our environment. # Don't let vs_toolchain overwrite our environment.
environ_bak = os.environ environ_bak = os.environ
...@@ -388,14 +389,21 @@ def GetWinSDKDir(): ...@@ -388,14 +389,21 @@ def GetWinSDKDir():
win_sdk_dir = vs_toolchain.SetEnvironmentAndGetSDKDir() win_sdk_dir = vs_toolchain.SetEnvironmentAndGetSDKDir()
msvs_version = vs_toolchain.GetVisualStudioVersion() msvs_version = vs_toolchain.GetVisualStudioVersion()
if bool(int(os.environ.get('DEPOT_TOOLS_WIN_TOOLCHAIN', '1'))):
dia_path = os.path.join(win_sdk_dir, '..', 'DIA SDK', 'bin', 'amd64')
else:
vs_path = vs_toolchain.DetectVisualStudioPath()
dia_path = os.path.join(vs_path, 'DIA SDK', 'bin', 'amd64')
dia_dll = os.path.join(dia_path, DIA_DLL[msvs_version])
os.environ = environ_bak os.environ = environ_bak
return win_sdk_dir return win_sdk_dir
def CopyDiaDllTo(target_dir): def CopyDiaDllTo(target_dir):
# This script always wants to use the 64-bit msdia*.dll. # This script always wants to use the 64-bit msdia*.dll.
dia_path = os.path.join(GetWinSDKDir(), '..', 'DIA SDK', 'bin', 'amd64') GetWinSDKDir()
dia_dll = os.path.join(dia_path, DIA_DLL[msvs_version])
CopyFile(dia_dll, target_dir) CopyFile(dia_dll, target_dir)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment