Skip to content

Generate compilation database using clang++ #42

Description

@pinventado

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:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions