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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 return '_test.' in dent or dent.startswith('example_') | 70 return '_test.' in dent or dent.startswith('example_') |
71 | 71 |
72 | 72 |
73 def FindCFiles(directory, filter_func): | 73 def FindCFiles(directory, filter_func): |
74 """Recurses through directory and returns a list of paths to all the C source | 74 """Recurses through directory and returns a list of paths to all the C source |
75 files that pass filter_func.""" | 75 files that pass filter_func.""" |
76 cfiles = [] | 76 cfiles = [] |
77 | 77 |
78 for (path, dirnames, filenames) in os.walk(directory): | 78 for (path, dirnames, filenames) in os.walk(directory): |
79 for filename in filenames: | 79 for filename in filenames: |
80 if not filename.endswith('.c') and not filename.endswith('.cc'): | 80 if filename.endswith('.c') and filter_func(filename, False): |
| 81 cfiles.append(os.path.join(path, filename)) |
81 continue | 82 continue |
82 if not filter_func(filename, False): | |
83 continue | |
84 cfiles.append(os.path.join(path, filename)) | |
85 | 83 |
86 for (i, dirname) in enumerate(dirnames): | 84 for (i, dirname) in enumerate(dirnames): |
87 if not filter_func(dirname, True): | 85 if not filter_func(dirname, True): |
88 del dirnames[i] | 86 del dirnames[i] |
89 | 87 |
90 return cfiles | 88 return cfiles |
91 | 89 |
92 | 90 |
93 def ExtractPerlAsmFromCMakeFile(cmakefile): | 91 def ExtractPerlAsmFromCMakeFile(cmakefile): |
94 """Parses the contents of the CMakeLists.txt file passed as an argument and | 92 """Parses the contents of the CMakeLists.txt file passed as an argument and |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 for test in test_names: | 248 for test in test_names: |
251 test_gypi.write(""" '%s',\n""" % test) | 249 test_gypi.write(""" '%s',\n""" % test) |
252 | 250 |
253 test_gypi.write(' ],\n }\n}\n') | 251 test_gypi.write(' ],\n }\n}\n') |
254 | 252 |
255 return 0 | 253 return 0 |
256 | 254 |
257 | 255 |
258 if __name__ == '__main__': | 256 if __name__ == '__main__': |
259 sys.exit(main()) | 257 sys.exit(main()) |
OLD | NEW |