Skip to content

Commit

Permalink
GH-36124: [C++] Export compile_commands.json by default (#37426)
Browse files Browse the repository at this point in the history
`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>
  • Loading branch information
bkietz committed Aug 28, 2023
1 parent af97607 commit 8e41366
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cpp/CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"hidden": true,
"generator": "Ninja",
"cacheVariables": {
"ARROW_BUILD_STATIC": "OFF"
"ARROW_BUILD_STATIC": "OFF",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
}
},
{
Expand Down

0 comments on commit 8e41366

Please sign in to comment.