Skip to content

Instantly share code, notes, and snippets.

@AlexisTM
Created November 24, 2020 13:53
Show Gist options
  • Save AlexisTM/a6bb5ee488611e15114aa190b6f79404 to your computer and use it in GitHub Desktop.
Save AlexisTM/a6bb5ee488611e15114aa190b6f79404 to your computer and use it in GitHub Desktop.
Merge multiple compile_commands.json
# This is to be used with catkin_make or catkin_tools if we want to merge compile_commands.txt in a single file to allow some tools to work such as Sourcetail.
sudo apt install jq
jq -s 'map(.[])' PATH_TO_COMPILE_COMMANDS_ROOT/**/compile_commands.json > compile_commands.json
@urev
Copy link

urev commented Sep 16, 2023

find . -iname "compile_commands.json" | xargs jq -s 'map(.[])' > output.json

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