diff options
author | djsollen <djsollen@google.com> | 2014-11-25 08:25:29 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-25 08:25:29 -0800 |
commit | 6f78a6448b8532722eeb8ce1191caa1c3a999df8 (patch) | |
tree | 431dc605d238d22132016f3a7bb3c889a7013e97 | |
parent | be2284de556e7ec29489693093d42dc86b762645 (diff) |
fix for the msvs gyp generator that produces nonposix path separators
BUG=skia:3139
Review URL: https://codereview.chromium.org/753313002
-rw-r--r-- | tools/generate_includes_cpp.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/tools/generate_includes_cpp.py b/tools/generate_includes_cpp.py index 1a6f117c63..abea1377d8 100644 --- a/tools/generate_includes_cpp.py +++ b/tools/generate_includes_cpp.py @@ -15,7 +15,7 @@ import re def is_ignored(full_path, ignore_list): for ignore_path in ignore_list: - if re.match(full_path, ignore_path, re.I): + if re.search(ignore_path, full_path, re.I): return True return False @@ -66,7 +66,18 @@ def main(): include_dirs: directories to traverse for include files""") (options, args) = parser.parse_args() - GenerateIncludeCPP(args[0], args[1:], options.ignore.split()) + # The MSVS gyp generator uses windows path separators so we intercept those + # strings and normalize them to our expected posix representation + include_dirs = [] + for include_dir in args[1:]: + include_dirs.append(include_dir.replace("\\", "/")) + ignore_list = options.ignore.replace("\\", "/") + + # We can strip off the relative portion of the path to ensure that when we + # compare for regex matches we don't fail based on relative path depth + ignore_list = ignore_list.replace("../", "") + + GenerateIncludeCPP(args[0], include_dirs, ignore_list.split()) if __name__ == "__main__": |