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
[C++] Export compile commands database by default #36124
Comments
CMake also reads this from an environment variable (in 3.17+), so developers can just individually set that in their shell configuration and get it for all CMake projects. |
I'm gonna +1 this issue as when I was setting up my tooling it took a bit of research before I found the |
+1, whenever I set up a new dev environment I'll need to google this variable because it's hard to remember the name verbatim. Would be nice to have it in the preset. |
This sounds reasonable, do you want to do it @bkietz ? |
`CMakePresets.json` does not export `compile_commands.json` by default, which is used by all clang tooling. Adding it as a default ensures that new developers (or any others who forget to specifically specify the option) will still be able to use their language servers without regenerating the cmake build dir. The relevant option is `"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"`, and causes generation of a ~1MB file at build time. * Closes: #36124 Authored-by: Benjamin Kietzman <bengilgit@gmail.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
…#37426) `CMakePresets.json` does not export `compile_commands.json` by default, which is used by all clang tooling. Adding it as a default ensures that new developers (or any others who forget to specifically specify the option) will still be able to use their language servers without regenerating the cmake build dir. The relevant option is `"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"`, and causes generation of a ~1MB file at build time. * Closes: apache#36124 Authored-by: Benjamin Kietzman <bengilgit@gmail.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
Describe the enhancement requested
CMakePresets.json
does not export compile commands by default. The relevant option is"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
and produces a filecompile_commands.json
which is used by clang tooling. The file is not huge; about 1MB. IMHO it'd be worthwhile to enable this by default so that developers always have access to it without needing to regenerate their cmake build dir; language servers and other tooling can be silently disabled without the compile commands database. See also discussion hereComponent(s)
C++
The text was updated successfully, but these errors were encountered: