Index: tools/isolate_driver.py |
diff --git a/tools/isolate_driver.py b/tools/isolate_driver.py |
index 6c9f11886633c1343297e885204e50cbb3560fa2..f51b824cb63e75b58f0f91d1b69dd11dc17b7963 100755 |
--- a/tools/isolate_driver.py |
+++ b/tools/isolate_driver.py |
@@ -24,6 +24,7 @@ import json |
import logging |
import os |
import posixpath |
+import re |
import StringIO |
import subprocess |
import sys |
@@ -141,7 +142,9 @@ def raw_build_to_deps(item): |
# TODO(maruel): Use a whitelist instead? .stamp, .so.TOC, .dylib.TOC, |
# .dll.lib, .exe and empty. |
# The first item is the build rule, e.g. 'link', 'cxx', 'phony', etc. |
- return filter(using_blacklist, item.split(' ')[1:]) |
+ # In ninja build files, spaces in targets are escaped with a $-prefix. |
+ # Use a negative lookbehind to not split on '$ '. |
+ return filter(using_blacklist, re.split('(?<!\$) ', item)[1:]) |
def collect_deps(target, build_steps, dependencies_added, rules_seen): |