0
0
Fork 0
mirror of https://github.com/denoland/rusty_v8.git synced 2024-11-24 15:19:31 -05:00
denoland-rusty-v8/tools/get_bindgen_args.py

21 lines
509 B
Python

import argparse
import json
import os
parser = argparse.ArgumentParser(description='Generate args for bindgen')
parser.add_argument('--gn-out', help='GN out directory')
args = parser.parse_args()
with open(os.path.join(args.gn_out, 'project.json')) as project_json:
project = json.load(project_json)
target = project['targets']['//v8:v8_headers']
assert '//v8:cppgc_headers' in target['deps']
args = []
for define in target['defines']:
args.append(f'-D{define}')
print('\0'.join(args), end="")