Skip to content

Commit c6d56fc

Browse files
committed
Intercept source files in linker_interceptor.py (#68)
1 parent 7c3c787 commit c6d56fc

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

linker_interceptor.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
out_args = []
1919
shareds = []
20+
sources = []
2021
search = []
2122
rpath = []
2223

@@ -69,12 +70,18 @@ def process_args(args):
6970
process_args(args)
7071

7172
if is_linking_qemu:
73+
with open("compile_commands.json", 'r') as f:
74+
compile_commands = json.load(f)
75+
for entry in compile_commands:
76+
sources.append(entry["file"])
77+
7278
with open(OUT, 'w') as f:
7379
json.dump({
7480
'cmd': out_args,
7581
'libs': shareds,
7682
'search': search,
7783
'rpath': rpath,
84+
'sources': sources,
7885
}, f, indent=2)
7986

8087
r = subprocess.run([cc] + args)

0 commit comments

Comments
 (0)