Skip to content

Commit

Permalink
Update CMake help text and comment for compilation database
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinWMatthews committed Feb 10, 2021
1 parent 2ed59cf commit acf8e1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmake/CompilationDatabase.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ Generate compilation database (compile_commands.json).
This is used by tools such as clangd for indexing the source code.
#]]

option(BUILD_COMPILATION_DATABASE "Generate compilation database (compile_commands.json)" ON)
option(BUILD_COMPILATION_DATABASE "Generate compilation database/Clang abstract syntax tree (compile_commands.json)" ON)
if(BUILD_COMPILATION_DATABASE)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
add_custom_target(set_compile_commands
COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_BINARY_DIR}/compile_commands.json ${PROJECT_SOURCE_DIR}/compile_commands.json
COMMENT "Symlinking compile_commands.json into the project root"
COMMENT "Symlinking compilation database into the project root"
)
else()
set(CMAKE_EXPORT_COMPILE_COMMANDS OFF)
Expand Down

0 comments on commit acf8e1a

Please sign in to comment.