Skip to content

Commit

Permalink
Automatically create compile-commands.json
Browse files Browse the repository at this point in the history
  • Loading branch information
joaander committed Sep 19, 2024
1 parent 25857ab commit c09cab3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
__pycache__
devdoc
build
.cache
*.pyc
.pytest_cache

# clangd
.clangd
.cache
compile_commands.json
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,13 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/extern/random123/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/extern/random123/examples)

add_subdirectory(fresnel)

# enable compile_commands.json
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if (NOT WIN32)
file(CREATE_LINK
"${CMAKE_BINARY_DIR}/compile_commands.json"
"${CMAKE_SOURCE_DIR}/compile_commands.json"
SYMBOLIC
)
endif()

0 comments on commit c09cab3

Please sign in to comment.