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
base: master
Are you sure you want to change the base?
Update usage.md #4154
Conversation
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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.