Skip to content

Commit

Permalink
do not copy compile_commands.json to source directory
Browse files Browse the repository at this point in the history
	modified:   .gitignore
	modified:   CMakeLists.txt
  • Loading branch information
Sajid Ali committed Aug 10, 2023
1 parent 9c98645 commit a3da9fa
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ cmake-build-*/
*.kdev?

# clangd LSP files
compile_commands.json
**.cache/clangd

# File-based project format:
Expand Down
5 changes: 0 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ if(${CMAKE_GENERATOR} STREQUAL "Unix Makefiles" OR ${CMAKE_GENERATOR} STREQUAL
"Ninja")
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# and place it in the source directory https://stackoverflow.com/a/60910583
add_custom_target(
copy-compile-commands ALL
${CMAKE_COMMAND} -E copy_if_different
${CMAKE_BINARY_DIR}/compile_commands.json ${PROJECT_SOURCE_DIR})
endif()
endif()

Expand Down

0 comments on commit a3da9fa

Please sign in to comment.