Adding compilation_db to panda builds (#1828)

This commit is contained in:
DevTekVE
2024-01-22 01:16:53 +01:00
committed by GitHub
parent 80731c0aa7
commit df030a9ca8
2 changed files with 14 additions and 1 deletions

View File

@@ -101,7 +101,8 @@ def build_project(project_name, project, extra_flags):
ASCOM="$AS $ASFLAGS -o $TARGET -c $SOURCES",
BUILDERS={
'Objcopy': Builder(generator=objcopy, suffix='.bin', src_suffix='.elf')
}
},
tools=["default", "compilation_db"],
)
startup = env.Object(f"obj/startup_{project_name}", project["STARTUP_FILE"])

View File

@@ -12,5 +12,17 @@ AddOption('--coverage',
action='store_true',
help='build with test coverage options')
AddOption('--compile_db',
action='store_true',
help='build clang compilation database')
env = Environment(
COMPILATIONDB_USE_ABSPATH=True,
tools=["default", "compilation_db"],
)
if GetOption('compile_db'):
env.CompilationDatabase("compile_commands.json")
# panda fw & test files
SConscript('SConscript')