Skip to content

Commit 57031e1

Browse files
committed
Add tool to generate compile_commands.json for bsp qemu-virt64-riscv
1 parent fa2d07e commit 57031e1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

bsp/qemu-virt64-riscv/SConstruct

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os
22
import sys
33
import rtconfig
4+
import scons_compiledb
45

56
from rtconfig import RTT_ROOT
67

@@ -11,13 +12,17 @@ TARGET = 'rtthread.' + rtconfig.TARGET_EXT
1112

1213
DefaultEnvironment(tools=[])
1314
env = Environment(tools = ['mingw'],
15+
COMPILATIONDB_USE_ABSPATH = True,
1416
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
1517
CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,
1618
CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS,
1719
AR = rtconfig.AR, ARFLAGS = '-rc',
1820
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
1921
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
2022
env['ASCOM'] = env['ASPPCOM']
23+
env.Tool('compilation_db')
24+
cdb = env.CompilationDatabase('compile_commands.json')
25+
Alias('cdb', cdb)
2126

2227
Export('RTT_ROOT')
2328
Export('rtconfig')

0 commit comments

Comments
 (0)