QEMU would like to use the result of extract_objects in a custom_target; examples are using objcopy, or using the object files as the key to look up command line arguments in compile_commands.json. This is slightly peculiar and not covered by the test suite, but it works; in order to avoid regressions, add a test case and document it.pull/8900/head
parent
d729ea3f69
commit
a656febccf
3 changed files with 30 additions and 1 deletions
@ -0,0 +1,21 @@ |
||||
#! /usr/bin/env python3 |
||||
|
||||
import json |
||||
import sys |
||||
import os |
||||
|
||||
cc = None |
||||
output = None |
||||
|
||||
# Only the ninja backend produces compile_commands.json |
||||
if sys.argv[1] == 'ninja': |
||||
with open('compile_commands.json', 'r') as f: |
||||
cc = json.load(f) |
||||
output = set((x['output'] for x in cc)) |
||||
|
||||
for obj in sys.argv[2:]: |
||||
if not os.path.exists(obj): |
||||
sys.exit(1) |
||||
if sys.argv[1] == 'ninja' and obj not in output: |
||||
sys.exit(1) |
||||
print('Verified', obj) |
Loading…
Reference in new issue