Intercept source files in linker_interceptor.py (#68)

This commit is contained in:
Romain Malmain 2024-04-26 15:43:28 +02:00
parent 7c3c7877d8
commit c6d56fc94c

View File

@ -17,6 +17,7 @@ else:
out_args = []
shareds = []
sources = []
search = []
rpath = []
@ -69,12 +70,18 @@ def process_args(args):
process_args(args)
if is_linking_qemu:
with open("compile_commands.json", 'r') as f:
compile_commands = json.load(f)
for entry in compile_commands:
sources.append(entry["file"])
with open(OUT, 'w') as f:
json.dump({
'cmd': out_args,
'libs': shareds,
'search': search,
'rpath': rpath,
'sources': sources,
}, f, indent=2)
r = subprocess.run([cc] + args)