[gn build] Do not sync filenames containing variable references
authorNico Weber <thakis@chromium.org>
Fri, 18 Sep 2020 19:34:21 +0000 (15:34 -0400)
committerNico Weber <thakis@chromium.org>
Fri, 18 Sep 2020 19:34:33 +0000 (15:34 -0400)
llvm/utils/gn/build/sync_source_lists_from_cmake.py

index a54483d..ae65b50 100755 (executable)
@@ -61,10 +61,10 @@ def sync_source_lists(write):
     gn_files = git_out(['ls-files', '*BUILD.gn']).splitlines()
 
     # Matches e.g. |   "foo.cpp",|, captures |foo| in group 1.
-    gn_cpp_re = re.compile(r'^\s*"([^"]+\.(?:cpp|c|h|S))",$', re.MULTILINE)
+    gn_cpp_re = re.compile(r'^\s*"([^$"]+\.(?:cpp|c|h|S))",$', re.MULTILINE)
     # Matches e.g. |   bar_sources = [ "foo.cpp" ]|, captures |foo| in group 1.
     gn_cpp_re2 = re.compile(
-        r'^\s*(?:.*_)?sources \+?= \[ "([^"]+\.(?:cpp|c|h|S))" ]$',
+        r'^\s*(?:.*_)?sources \+?= \[ "([^$"]+\.(?:cpp|c|h|S))" ]$',
         re.MULTILINE)
     # Matches e.g. |   foo.cpp|, captures |foo| in group 1.
     cmake_cpp_re = re.compile(r'^\s*([A-Za-z_0-9./-]+\.(?:cpp|c|h|S))$',