cmake: export compile commands for external tools
A lot of editors and debuggers use this file to support code completion, IntelliSense, etc. VS Code searches for it automatically, clangd, clang-tidy, clang-check, and IWYU all support it.
Supported since CMake 3.5, I believe our minimum is 3.12. https://cmake.org/cmake/help/latest/variable/CMAKE_EXPORT_COMPILE_COMMANDS.html