| # Copyright 2017 the V8 project authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| """The same as dump_build_config.py but for gyp legacy. |
| Expected to be called like: |
| dump_build_config.py path/to/file.json [key1=value1 ...] |
| Raw gyp values are supported - they will be tranformed into valid json. |
| # TODO(machenbach): Remove this when gyp is deprecated. |
| # for py2/py3 compatibility |
| from __future__ import print_function |
| 'shared_library': 'true', |
| 'static_library': 'false', |
| def gyp_to_gn(key, value): |
| value = GYP_GN_CONVERSION.get(key, DEFAULT_CONVERSION).get(value, value) |
| value = value if value in ['true', 'false'] else '"{0}"'.format(value) |
| with open(sys.argv[1], 'w') as f: |
| json.dump(dict(map(as_json, sys.argv[2:])), f) |