OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # Copyright 2014 The Chromium Authors. All rights reserved. | 3 # Copyright 2014 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """Given the output of -t commands from a ninja build for a gyp and GN generated | 7 """Given the output of -t commands from a ninja build for a gyp and GN generated |
8 build, report on differences between the command lines.""" | 8 build, report on differences between the command lines.""" |
9 | 9 |
10 | 10 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 # Filter for libFindBadConstructs.so having a relative path in one and | 106 # Filter for libFindBadConstructs.so having a relative path in one and |
107 # absolute path in the other. | 107 # absolute path in the other. |
108 others_filtered = [] | 108 others_filtered = [] |
109 for x in others: | 109 for x in others: |
110 if x.startswith('-Xclang ') and x.endswith('libFindBadConstructs.so'): | 110 if x.startswith('-Xclang ') and x.endswith('libFindBadConstructs.so'): |
111 others_filtered.append( | 111 others_filtered.append( |
112 '-Xclang ' + | 112 '-Xclang ' + |
113 os.path.join(os.getcwd(), | 113 os.path.join(os.getcwd(), |
114 os.path.normpath( | 114 os.path.normpath( |
115 os.path.join('out/gn_flags', x.split(' ', 1)[1])))) | 115 os.path.join('out/gn_flags', x.split(' ', 1)[1])))) |
| 116 elif x.startswith('-B'): |
| 117 others_filtered.append( |
| 118 '-B' + |
| 119 os.path.join(os.getcwd(), |
| 120 os.path.normpath(os.path.join('out/gn_flags', x[2:])))) |
116 else: | 121 else: |
117 others_filtered.append(x) | 122 others_filtered.append(x) |
118 others = others_filtered | 123 others = others_filtered |
119 | 124 |
120 flags_by_output[cc_file[0]] = { | 125 flags_by_output[cc_file[0]] = { |
121 'output': output_name, | 126 'output': output_name, |
122 'depname': dep_name, | 127 'depname': dep_name, |
123 'defines': sorted(defines), | 128 'defines': sorted(defines), |
124 'include_dirs': sorted(include_dirs), # TODO(scottmg): This is wrong. | 129 'include_dirs': sorted(include_dirs), # TODO(scottmg): This is wrong. |
125 'dash_f': sorted(dash_f), | 130 'dash_f': sorted(dash_f), |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 print '\n'.join(sorted(files)) | 218 print '\n'.join(sorted(files)) |
214 print diff | 219 print diff |
215 | 220 |
216 print 'Total differences:', g_total_differences | 221 print 'Total differences:', g_total_differences |
217 # TODO(scottmg): Return failure on difference once we're closer to identical. | 222 # TODO(scottmg): Return failure on difference once we're closer to identical. |
218 return 0 | 223 return 0 |
219 | 224 |
220 | 225 |
221 if __name__ == '__main__': | 226 if __name__ == '__main__': |
222 sys.exit(main()) | 227 sys.exit(main()) |
OLD | NEW |