Skip to content

Commit 49d95b6

Browse files
committed
[tools]: fix the path of compile_commands.json
1 parent 7a4ec25 commit 49d95b6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tools/vsc.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def generate_code_workspace_file(source_dirs,command_json_path,root_path):
162162

163163
def command_json_to_workspace(root_path,command_json_path):
164164

165-
with open('compile_commands.json', 'r') as f:
165+
with open('build/compile_commands.json', 'r') as f:
166166
compile_commands = json.load(f)
167167

168168
source_dirs = extract_source_dirs(compile_commands)
@@ -246,11 +246,11 @@ def GenerateCFiles(env):
246246
vsc_file.close()
247247

248248
"""
249-
Generate vscode.code-workspace files by compile_commands.json
249+
Generate vscode.code-workspace files by build/compile_commands.json
250250
"""
251-
if os.path.exists('compile_commands.json'):
251+
if os.path.exists('build/compile_commands.json'):
252252

253-
command_json_to_workspace(env['RTT_ROOT'],'compile_commands.json')
253+
command_json_to_workspace(env['RTT_ROOT'],'build/compile_commands.json')
254254
return
255255
"""
256256
Generate vscode.code-workspace files
@@ -282,7 +282,7 @@ def GenerateCFiles(env):
282282
segments = [p for p in normalized_path.split(os.path.sep) if p != '..']
283283
path['name'] = 'rtthread/' + '/'.join(segments)
284284
json_obj['folders'] = path_list
285-
if os.path.exists('compile_commands.json'):
285+
if os.path.exists('build/compile_commands.json'):
286286
json_obj['settings'] = {
287287
"clangd.arguments": [
288288
"--compile-commands-dir=.",

0 commit comments

Comments
 (0)