Skip to content

Commit

Permalink
Fix missing dependency error when BUILD_TESTING=OFF
Browse files Browse the repository at this point in the history
Without this patch, we get the following error:
```console
CMake Error at CMakeLists.txt:77 (add_dependencies):
  The dependency target "writer_tests" of target "clang-tidy" does not exist.
```
when `BUILD_TESTING=OFF`
  • Loading branch information
elfprince13 authored May 12, 2022
1 parent f379578 commit 4904953
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ if(CLANG_TIDY AND PROTOBUF_FOUND)
${CMAKE_SOURCE_DIR}/test/unit/*.cpp
${CMAKE_SOURCE_DIR}/tools/*.cpp
)
add_dependencies(clang-tidy writer_tests)
if(BUILD_TESTING)
add_dependencies(clang-tidy writer_tests)
endif()
else()
message(STATUS "Looking for clang-tidy - not found")
message(STATUS " Build target 'clang-tidy' will not be available.")
Expand Down

0 comments on commit 4904953

Please sign in to comment.