add compile_commands

This commit is contained in:
Michael Zhang 2024-08-09 03:52:49 -05:00
parent 8072fdf9a0
commit ee53cc032b

View file

@ -4,6 +4,14 @@ set(LEAN_VERSION_MAJOR 0)
set(LEAN_VERSION_MINOR 2) set(LEAN_VERSION_MINOR 2)
set(LEAN_VERSION_PATCH 0) set(LEAN_VERSION_PATCH 0)
# Generate the `compile_commands.json` file.
set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "")
if(CMAKE_EXPORT_COMPILE_COMMANDS)
set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES
${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES})
endif()
if (NOT CMAKE_BUILD_TYPE) if (NOT CMAKE_BUILD_TYPE)
message(STATUS "No build type selected, default to Release") message(STATUS "No build type selected, default to Release")
set(CMAKE_BUILD_TYPE "Release") set(CMAKE_BUILD_TYPE "Release")