ILXL / ILXL/cppaudit

Generate compilation database using clang++

Open
#42 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
1
Forks
1
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with gen_ccjs.sh and read the linked clang compilation-database documentation, then inspect how the current script is invoked. Replace its generation flow with the described clang++ -MJ approach, producing compile_commands.json and removing the temporary file; verify the resulting JSON format and existing build workflow.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, shell
Domain
build-system
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.