You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace the shell script for generating the compilation database (gen_ccjs.sh) with the generator from clang++.
Specifically, use the usually clang++ compilation command, but add a -MJ flag passing along a temporary json file. Finally add [ ] to the generated file. For example:
clang++ -std=c++17 -MJ temp.json main.cc -o main
sed -e '1s/^/[\n/' -e '$s/,$/\n]/' temp.json > compile_commands.json
rm temp.json
The text was updated successfully, but these errors were encountered:
It seems like compile_commands.json really just needs the .cc files. It doesn't even seem to check the value of the command attribute. It worked with "cat main.cc". Although clang++ works, does it make sense to just continue using our simpler bash script but removing the header files?
We will need to fix it though because it seems the current version of the script is only able to retrieve one implementation file. A possible solution is to use shift to remove all previous params, then loop through all the remaining strings, which are the .cc files
https://sarcasm.github.io/notes/dev/compilation-database.html#clang
Replace the shell script for generating the compilation database (gen_ccjs.sh) with the generator from clang++.
Specifically, use the usually clang++ compilation command, but add a
-MJ
flag passing along a temporary json file. Finally add[ ]
to the generated file. For example:The text was updated successfully, but these errors were encountered: