Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update usage.md #4154

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ArnaudBienner
Copy link
Contributor

I feel like it would be useful to mention alternatives to CodeChecker log here.

Personally, all my projects are running CMake, so using CMAKE_EXPORT_COMPILE_COMMANDS is more convenient than using CodeChecker log.

I didn't want to restate what was already documented in https://clang.llvm.org/docs/JSONCompilationDatabase.html so I simply reuse this link which was already there.

I feel like it would be useful to mention alternatives to `CodeChecker log` here.

Personally, all my projects are running CMake, so using `CMAKE_EXPORT_COMPILE_COMMANDS` is more convenient than using CodeChecker log.

I didn't want to restate what was already documented in https://clang.llvm.org/docs/JSONCompilationDatabase.html so I simply reuse this link which was already there.
You can check [LLVM documentation](https://clang.llvm.org/docs/JSONCompilationDatabase.html)
for the different options on how to generate this file.

Alternatively, you can run `CodeChecker log` command to generate a compilation database.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not a true equal alternative. For example, if code is generated during the build process (such as in the case of LLVM), then the CMake-generated compilation database will not be usable as an input if you don't also execute a build prior to analysis.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your answer.
I missed that.

@whisperity whisperity added the documentation 📖 Changes to documentation. label Feb 29, 2024
Please try to obtain the `compile_commands.json` in an other way, with the help of CMake for example.
Please try to obtain the `compile_commands.json` in an other way, with the help of
[CMake](https://cmake.org/cmake/help/latest/variable/CMAKE_EXPORT_COMPILE_COMMANDS.html)
for example.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So maybe I should close this PR and open a new one only keeping this last change? (link to CMake documentation), what do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for that, just create a new commit with the changes from your previous one. The merged PR will contain the merged sequence of the two commits. 🙂 So if you remove in commit 2 what you added in commit 1, it will simply not make it to the upstream repository at all.

@whisperity whisperity added enhancement 🌟 analyzer 📈 Related to the analyze commands (analysis driver) ld-logger 📃 labels Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer 📈 Related to the analyze commands (analysis driver) documentation 📖 Changes to documentation. enhancement 🌟 ld-logger 📃
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants