| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 | 2 |
| 3 # Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 3 # Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. |
| 4 # | 4 # |
| 5 # Use of this source code is governed by a BSD-style license | 5 # Use of this source code is governed by a BSD-style license |
| 6 # that can be found in the LICENSE file in the root of the source | 6 # that can be found in the LICENSE file in the root of the source |
| 7 # tree. An additional intellectual property rights grant can be found | 7 # tree. An additional intellectual property rights grant can be found |
| 8 # in the file PATENTS. All contributing project authors may | 8 # in the file PATENTS. All contributing project authors may |
| 9 # be found in the AUTHORS file in the root of the source tree. | 9 # be found in the AUTHORS file in the root of the source tree. |
| 10 | 10 |
| 11 # Searches for libraries or object files on the specified path and merges them | 11 # Searches for libraries or object files on the specified path and merges them |
| 12 # them into a single library. Assumes ninja is used on all platforms. | 12 # them into a single library. Assumes ninja is used on all platforms. |
| 13 | 13 |
| 14 import fnmatch | 14 import fnmatch |
| 15 import os | 15 import os |
| 16 import subprocess | 16 import subprocess |
| 17 import sys | 17 import sys |
| 18 | 18 |
| 19 IGNORE_PATTERNS = ['do_not_use', 'protoc'] | 19 IGNORE_PATTERNS = ['do_not_use', 'protoc', 'genperf'] |
| 20 | 20 |
| 21 def FindFiles(path, pattern): | 21 def FindFiles(path, pattern): |
| 22 """Finds files matching |pattern| under |path|. | 22 """Finds files matching |pattern| under |path|. |
| 23 | 23 |
| 24 Returns a list of file paths matching |pattern|, by walking the directory tree | 24 Returns a list of file paths matching |pattern|, by walking the directory tree |
| 25 under |path|. Filenames containing the string 'do_not_use' or 'protoc' are | 25 under |path|. Filenames containing the string 'do_not_use' or 'protoc' are |
| 26 excluded. | 26 excluded. |
| 27 | 27 |
| 28 Args: | 28 Args: |
| 29 path: The root path for the search. | 29 path: The root path for the search. |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 ' -and -not -name '.join(IGNORE_PATTERNS) + | 78 ' -and -not -name '.join(IGNORE_PATTERNS) + |
| 79 ' -exec', cmd, output_lib, '{} +']) | 79 ' -exec', cmd, output_lib, '{} +']) |
| 80 else: | 80 else: |
| 81 cmd = ' '.join([cmd + output_lib] + FindFiles(search_path, pattern)) | 81 cmd = ' '.join([cmd + output_lib] + FindFiles(search_path, pattern)) |
| 82 print cmd | 82 print cmd |
| 83 subprocess.check_call(cmd, shell=True) | 83 subprocess.check_call(cmd, shell=True) |
| 84 return 0 | 84 return 0 |
| 85 | 85 |
| 86 if __name__ == '__main__': | 86 if __name__ == '__main__': |
| 87 sys.exit(main(sys.argv)) | 87 sys.exit(main(sys.argv)) |
| OLD | NEW |