OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/env python |
| 2 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. |
| 5 |
| 6 """ |
| 7 Replaces gyp files in tree with files from here that |
| 8 make the build use system libraries. |
| 9 """ |
| 10 |
| 11 |
| 12 import os.path |
| 13 import shutil |
| 14 import sys |
| 15 |
| 16 |
| 17 REPLACEMENTS = { |
| 18 'use_system_harfbuzz': 'third_party/harfbuzz-ng/harfbuzz.gyp', |
| 19 } |
| 20 |
| 21 |
| 22 def DoMain(argv): |
| 23 my_dirname = os.path.dirname(__file__) |
| 24 source_tree_root = os.path.abspath( |
| 25 os.path.join(my_dirname, '..', '..', '..')) |
| 26 |
| 27 for flag, path in REPLACEMENTS.items(): |
| 28 # Accept arguments in gyp command-line syntax, and ignore other |
| 29 # parameters, so that the caller can re-use command-line for this |
| 30 # script and gyp. |
| 31 if '-D%s=1' % flag not in argv: |
| 32 continue |
| 33 |
| 34 # Copy the gyp file from directory of this script to target path. |
| 35 shutil.copyfile(os.path.join(my_dirname, os.path.basename(path)), |
| 36 os.path.join(source_tree_root, path)) |
| 37 |
| 38 return 0 |
| 39 |
| 40 |
| 41 if __name__ == '__main__': |
| 42 sys.exit(DoMain(sys.argv)) |
OLD | NEW |