diff options
author | Brian Osman <brianosman@google.com> | 2017-12-11 14:59:03 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-12-11 20:26:08 +0000 |
commit | 5c548924123227f1a3d1c03a2ff936161a06d631 (patch) | |
tree | b12cc095ec0c6219ecda9b3764985915d2781b8d /gn | |
parent | dba0bc843aac109106caf9dbe6a1a9f8c47f6ad1 (diff) |
Filter Windows SDK and Compiler directories
This avoids bugs when other directories (like the Driver SDK) show up in
those folders.
Bug: skia:7395
Change-Id: Iee316a7daf8d71223b999de736d63e1dc7fa31f7
Reviewed-on: https://skia-review.googlesource.com/83542
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'gn')
-rw-r--r-- | gn/BUILDCONFIG.gn | 10 | ||||
-rw-r--r-- | gn/highest_version_dir.py | 6 |
2 files changed, 12 insertions, 4 deletions
diff --git a/gn/BUILDCONFIG.gn b/gn/BUILDCONFIG.gn index 80cc0986cc..0e93f0a6b6 100644 --- a/gn/BUILDCONFIG.gn +++ b/gn/BUILDCONFIG.gn @@ -164,12 +164,18 @@ if (target_os == "win") { if (target_os == "win") { if (msvc == 2017 && win_toolchain_version == "") { win_toolchain_version = exec_script("//gn/highest_version_dir.py", - [ "$win_vc/Tools/MSVC" ], + [ + "$win_vc/Tools/MSVC", + "[0-9]{2}\.[0-9]{2}\.[0-9]{5}", + ], "trim string") } if (win_sdk_version == "") { win_sdk_version = exec_script("//gn/highest_version_dir.py", - [ "$win_sdk/Include" ], + [ + "$win_sdk/Include", + "[0-9]{2}\.[0-9]\.[0-9]{5}\.[0-9]", + ], "trim string") } } diff --git a/gn/highest_version_dir.py b/gn/highest_version_dir.py index 650154e4f3..1b82697d9a 100644 --- a/gn/highest_version_dir.py +++ b/gn/highest_version_dir.py @@ -6,8 +6,10 @@ # found in the LICENSE file. import os +import re import sys -dirpath, = sys.argv[1:] +dirpath = sys.argv[1] +regex = re.compile(sys.argv[2]) -print sorted(os.listdir(dirpath))[-1] +print sorted(filter(regex.match, os.listdir(dirpath)))[-1] |