OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can b | 2 # Use of this source code is governed by a BSD-style license that can b |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Enumerates the BoringSSL source in src/ and generates two gypi files: | 5 """Enumerates the BoringSSL source in src/ and generates two gypi files: |
6 boringssl.gypi and boringssl_tests.gypi.""" | 6 boringssl.gypi and boringssl_tests.gypi.""" |
7 | 7 |
8 import os | 8 import os |
9 import subprocess | 9 import subprocess |
10 import sys | 10 import sys |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 (osname, arch), asm_files) | 199 (osname, arch), asm_files) |
200 | 200 |
201 gypi.write(' }\n}\n') | 201 gypi.write(' }\n}\n') |
202 | 202 |
203 test_c_files = FindCFiles(os.path.join('src', 'crypto'), OnlyTests) | 203 test_c_files = FindCFiles(os.path.join('src', 'crypto'), OnlyTests) |
204 | 204 |
205 with open('boringssl_tests.gypi', 'w+') as test_gypi: | 205 with open('boringssl_tests.gypi', 'w+') as test_gypi: |
206 test_gypi.write(FILE_HEADER + '{\n \'targets\': [\n') | 206 test_gypi.write(FILE_HEADER + '{\n \'targets\': [\n') |
207 | 207 |
208 test_names = [] | 208 test_names = [] |
209 for test in test_c_files: | 209 for test in sorted(test_c_files): |
210 test_name = 'boringssl_%s' % os.path.splitext(os.path.basename(test))[0] | 210 test_name = 'boringssl_%s' % os.path.splitext(os.path.basename(test))[0] |
211 test_gypi.write(""" { | 211 test_gypi.write(""" { |
212 'target_name': '%s', | 212 'target_name': '%s', |
213 'type': 'executable', | 213 'type': 'executable', |
214 'dependencies': [ | 214 'dependencies': [ |
215 'boringssl', | 215 'boringssl', |
216 ], | 216 ], |
217 'sources': [ | 217 'sources': [ |
218 '%s', | 218 '%s', |
219 ], | 219 ], |
220 },\n""" % (test_name, test)) | 220 },\n""" % (test_name, test)) |
221 test_names.append(test_name) | 221 test_names.append(test_name) |
222 | 222 |
223 test_names.sort() | 223 test_names.sort() |
224 | 224 |
225 test_gypi.write(""" ], | 225 test_gypi.write(""" ], |
226 'variables': { | 226 'variables': { |
227 'boringssl_test_targets': [\n""") | 227 'boringssl_test_targets': [\n""") |
228 | 228 |
229 for test in test_names: | 229 for test in test_names: |
230 test_gypi.write(""" '%s',\n""" % test) | 230 test_gypi.write(""" '%s',\n""" % test) |
231 | 231 |
232 test_gypi.write(' ],\n }\n}\n') | 232 test_gypi.write(' ],\n }\n}\n') |
233 | 233 |
234 return 0 | 234 return 0 |
235 | 235 |
236 | 236 |
237 if __name__ == '__main__': | 237 if __name__ == '__main__': |
238 sys.exit(main()) | 238 sys.exit(main()) |
OLD | NEW |