diff options
author | brucedawson <brucedawson@chromium.org> | 2016-03-22 17:58:06 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-23 00:59:30 +0000 |
commit | 12bbca48cda56b2a10a68f8f69bb90906189c4bf (patch) | |
tree | bb5ede2d20600c828ce1a058746313a03da23e1b /build | |
parent | 0f2c9b7550bb338b5581255003de08e71c913720 (diff) | |
download | chromium_src-12bbca48cda56b2a10a68f8f69bb90906189c4bf.zip chromium_src-12bbca48cda56b2a10a68f8f69bb90906189c4bf.tar.gz chromium_src-12bbca48cda56b2a10a68f8f69bb90906189c4bf.tar.bz2 |
Strip trailing backslashes from vcvarsall results
When building with DEPOT_TOOLS_WIN_TOOLCHAIN=0 the vs_toolchain.py
script uses environment variables set up by vcvarsall.bat, such as
WINDOWSSDKDIR. The default value of this with VS 2015 is
WindowsSdkDir=C:\Program Files (x86)\Windows Kits\10\ - note the
trailing slash.
When ninja runs "build\vs_toolchain.py get_toolchain_dir" it translates
this to:
sdk_path = "C:\Program Files (x86)\Windows Kits\10\"
The trailing slash in front of the quote confuses the gn parser. This
change strips those trailing slashes. For more details see the gn
docs:
https://chromium.googlesource.com/chromium/src/+/master/tools/gn/docs/language.md#Strings
BUG=593154
Review URL: https://codereview.chromium.org/1827663002
Cr-Commit-Position: refs/heads/master@{#382752}
Diffstat (limited to 'build')
-rwxr-xr-x | build/vs_toolchain.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/build/vs_toolchain.py b/build/vs_toolchain.py index 2977159..4d0380e 100755 --- a/build/vs_toolchain.py +++ b/build/vs_toolchain.py @@ -331,6 +331,12 @@ def Update(force=False): return 0 +def NormalizePath(path): + while path.endswith("\\"): + path = path[:-1] + return path + + def GetToolchainDir(): """Gets location information about the current toolchain (must have been previously updated by 'update'). This is used for the GN build.""" @@ -348,10 +354,10 @@ vs_version = "%s" wdk_dir = "%s" runtime_dirs = "%s" ''' % ( - os.environ['GYP_MSVS_OVERRIDE_PATH'], - os.environ['WINDOWSSDKDIR'], + NormalizePath(os.environ['GYP_MSVS_OVERRIDE_PATH']), + NormalizePath(os.environ['WINDOWSSDKDIR']), GetVisualStudioVersion(), - os.environ.get('WDK_DIR', ''), + NormalizePath(os.environ.get('WDK_DIR', '')), os.path.pathsep.join(runtime_dll_dirs or ['None'])) |