Export compile commands JSON by default
Lots of VSCode C++ extensions use a compile_commands.json
file to figure out include paths etc...
Normally a user has to manually add -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
to their build command to get CMake to export this file. This MR makes this happen by default by setting the variable inside CMakeLists.txt
. The compile_commands.json
file gets generated in the build directory so it shouldn't get in anyone's way, so I think it's reasonable to have this option set by default.