From 62770bb067d2c79bc83c82f2e45063ee73754c39 Mon Sep 17 00:00:00 2001 From: Greg Tatum Date: Wed, 16 Aug 2023 10:14:56 -0500 Subject: [PATCH] Generate a compile_commands.json by default with cmake (#461) --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 82940de82..d8a2d00cb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,10 @@ project(bergamot_translator CXX C) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) +# Generate a compile_commands.json in the build directory. The compile commands allow +# code editors to understand the build process and provide static analysis of the code. +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + # Note that with CMake MSVC build, the option CMAKE_BUILD_TYPE is automatically derived from the key # 'configurationType' in CMakeSettings.json configurations if(NOT CMAKE_BUILD_TYPE)