Skip to content

Instantly share code, notes, and snippets.

@antznin
Created April 17, 2023 13:56
Show Gist options
  • Save antznin/b1fabb94201cb8ba8b56e9d5bd850a89 to your computer and use it in GitHub Desktop.
Save antznin/b1fabb94201cb8ba8b56e9d5bd850a89 to your computer and use it in GitHub Desktop.
Generate compile_commands.json file with a Linux bbappend
do_gen_compile_commands () {
python3 ${S}/scripts/clang-tools/gen_compile_commands.py \
--directory "${B}" \
--ar "${AR}" \
--log_level DEBUG \
--output "${B}/compile_commands.json"
bbnote "Generated ${B}/compile_commands.json"
}
do_gen_compile_commands[doc] = "Generate compile_commands.json file for use with clangd"
do_gen_compile_commands[depends] += "python3-native:do_populate_sysroot"
addtask do_gen_compile_commands after do_compile_kernelmodules
@antznin
Copy link
Author

antznin commented Apr 17, 2023

Tested with linux-ti-staging version 5.10 in a Yocto Kirkstone environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment