From 7cbfdcaa9358204a11d222e6627d82a278ba058b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Chocholat=C3=BD?= Date: Tue, 5 Sep 2023 10:33:09 +0200 Subject: [PATCH] Store compile commands --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index c223359d7..e61b668f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,9 @@ option(MATA_ENABLE_COVERAGE "Build with coverage compiler flags" OFF) # Only do these if this is the main project, and not if it is included through add_subdirectory if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) + # Store compile commands into 'build/compile_commands.json', which are needed, beside others, for linters. + set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + option(MATA_BUILD_EXAMPLES "Build Mata examples" ON) message("-- Default C++ compiler: ${CMAKE_CXX_COMPILER}")