OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2016 The Chromium Authors. All rights reserved. | 2 # Copyright 2016 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """ | 6 """ |
7 Replaces GN files in tree with files from here that | 7 Replaces GN files in tree with files from here that |
8 make the build use system libraries. | 8 make the build use system libraries. |
9 """ | 9 """ |
10 | 10 |
11 from __future__ import print_function | 11 from __future__ import print_function |
12 | 12 |
13 import argparse | 13 import argparse |
14 import os | 14 import os |
15 import shutil | 15 import shutil |
16 import sys | 16 import sys |
17 | 17 |
18 | 18 |
19 REPLACEMENTS = { | 19 REPLACEMENTS = { |
20 'libxml': 'third_party/libxml/BUILD.gn', | 20 'libxml': 'third_party/libxml/BUILD.gn', |
| 21 'zlib': 'third_party/zlib/BUILD.gn', |
21 } | 22 } |
22 | 23 |
23 | 24 |
24 def DoMain(argv): | 25 def DoMain(argv): |
25 my_dirname = os.path.dirname(__file__) | 26 my_dirname = os.path.dirname(__file__) |
26 source_tree_root = os.path.abspath( | 27 source_tree_root = os.path.abspath( |
27 os.path.join(my_dirname, '..', '..', '..')) | 28 os.path.join(my_dirname, '..', '..', '..')) |
28 | 29 |
29 parser = argparse.ArgumentParser() | 30 parser = argparse.ArgumentParser() |
30 parser.add_argument('--system-libraries', nargs='*', default=[]) | 31 parser.add_argument('--system-libraries', nargs='*', default=[]) |
(...skipping 25 matching lines...) Expand all Loading... |
56 if unhandled_libraries: | 57 if unhandled_libraries: |
57 print('Unrecognized system libraries requested: %s' % ', '.join( | 58 print('Unrecognized system libraries requested: %s' % ', '.join( |
58 sorted(unhandled_libraries)), file=sys.stderr) | 59 sorted(unhandled_libraries)), file=sys.stderr) |
59 return 1 | 60 return 1 |
60 | 61 |
61 return 0 | 62 return 0 |
62 | 63 |
63 | 64 |
64 if __name__ == '__main__': | 65 if __name__ == '__main__': |
65 sys.exit(DoMain(sys.argv[1:])) | 66 sys.exit(DoMain(sys.argv[1:])) |
OLD | NEW |