@@ -61,13 +61,13 @@ def git_out(args):
6161 gn_files = git_out (["ls-files" , "*BUILD.gn" ]).splitlines ()
6262
6363 # Matches e.g. | "foo.cpp",|, captures |foo| in group 1.
64- gn_cpp_re = re .compile (r'^\s*"([^$"]+\.(?:cpp|c|h|S))",$' , re .MULTILINE )
64+ gn_cpp_re = re .compile (r'^\s*"([^$"]+\.(?:cpp|c|h|mm| S))",$' , re .MULTILINE )
6565 # Matches e.g. | bar_sources = [ "foo.cpp" ]|, captures |foo| in group 1.
6666 gn_cpp_re2 = re .compile (
67- r'^\s*(?:.*_)?sources \+?= \[ "([^$"]+\.(?:cpp|c|h|S))" ]$' , re .MULTILINE
67+ r'^\s*(?:.*_)?sources \+?= \[ "([^$"]+\.(?:cpp|c|h|mm| S))" ]$' , re .MULTILINE
6868 )
6969 # Matches e.g. | foo.cpp|, captures |foo| in group 1.
70- cmake_cpp_re = re .compile (r"^\s*([A-Za-z_0-9./-]+\.(?:cpp|c|h|S))$" , re .MULTILINE )
70+ cmake_cpp_re = re .compile (r"^\s*([A-Za-z_0-9./-]+\.(?:cpp|c|h|mm| S))$" , re .MULTILINE )
7171
7272 changes_by_rev = defaultdict (lambda : defaultdict (lambda : defaultdict (list )))
7373
@@ -108,6 +108,12 @@ def get_sources(source_re, text):
108108
109109 gn_cpp = get_sources (gn_cpp_re , open (gn_file ).read ())
110110 gn_cpp |= get_sources (gn_cpp_re2 , open (gn_file ).read ())
111+
112+ sources_file = os .path .join (os .path .dirname (gn_file ), "sources.gni" )
113+ if os .path .exists (sources_file ):
114+ gn_cpp |= get_sources (gn_cpp_re , open (sources_file ).read ())
115+ gn_cpp |= get_sources (gn_cpp_re2 , open (sources_file ).read ())
116+
111117 cmake_cpp = get_sources (cmake_cpp_re , open (cmake_file ).read ())
112118
113119 if gn_cpp == cmake_cpp :
0 commit comments