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 filename.endswith('.c') and filter_func(filename, False): | 80 if not filename.endswith('.c') and not filename.endswith('.cc'): |
81 cfiles.append(os.path.join(path, filename)) | |
82 continue | 81 continue |
| 82 if not filter_func(filename, False): |
| 83 continue |
| 84 cfiles.append(os.path.join(path, filename)) |
83 | 85 |
84 for (i, dirname) in enumerate(dirnames): | 86 for (i, dirname) in enumerate(dirnames): |
85 if not filter_func(dirname, True): | 87 if not filter_func(dirname, True): |
86 del dirnames[i] | 88 del dirnames[i] |
87 | 89 |
88 return cfiles | 90 return cfiles |
89 | 91 |
90 | 92 |
91 def ExtractPerlAsmFromCMakeFile(cmakefile): | 93 def ExtractPerlAsmFromCMakeFile(cmakefile): |
92 """Parses the contents of the CMakeLists.txt file passed as an argument and | 94 """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... |
248 for test in test_names: | 250 for test in test_names: |
249 test_gypi.write(""" '%s',\n""" % test) | 251 test_gypi.write(""" '%s',\n""" % test) |
250 | 252 |
251 test_gypi.write(' ],\n }\n}\n') | 253 test_gypi.write(' ],\n }\n}\n') |
252 | 254 |
253 return 0 | 255 return 0 |
254 | 256 |
255 | 257 |
256 if __name__ == '__main__': | 258 if __name__ == '__main__': |
257 sys.exit(main()) | 259 sys.exit(main()) |
OLD | NEW |