mirror of
https://github.com/denoland/rusty_v8.git
synced 2024-11-23 15:17:01 -05:00
21 lines
509 B
Python
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="")
|