Skip to content

Commit

Permalink
CMake: export compile commands w/ include dirs for clangd to work
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom94 committed Nov 27, 2024
1 parent 5e45f92 commit 0d782bd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ endif()
# Not available until cmake 3.6, but doesn't break older versions.
set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT tev)

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()

# Set a default configuration if none was specified
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "No release type specified. Setting to 'Release'.")
Expand Down

0 comments on commit 0d782bd

Please sign in to comment.