Enable CMake "compile_commands.json" Output (#3854)

Co-authored-by: John Tramm <jtramm@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
John Tramm 2026-03-05 17:20:54 -06:00 committed by GitHub
parent dbfd6387b2
commit 533f09defd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -20,6 +20,11 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
# Generate compile_commands.json for clangd and other tools
if("${CMAKE_EXPORT_COMPILE_COMMANDS}" STREQUAL "")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
endif()
# Enable correct usage of CXX_EXTENSIONS
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.22)
cmake_policy(SET CMP0128 NEW)