protozero icon indicating copy to clipboard operation
protozero copied to clipboard

Configuration error when tests are disabled but clang_tidy is found

Open kelteseth opened this issue 3 years ago • 1 comments

writer_tests used in add_dependencies does only exist if tests are enabled. Add an additional AND BUILD_TESTING:

if(CLANG_TIDY AND PROTOBUF_FOUND AND BUILD_TESTING)
    message(STATUS "Looking for clang-tidy - found ${CLANG_TIDY}")
    add_custom_target(clang-tidy
        ${CLANG_TIDY}
        -p ${CMAKE_BINARY_DIR}
        ${CMAKE_SOURCE_DIR}/test/*.cpp
        ${CMAKE_SOURCE_DIR}/test/t/*/reader_test_cases.cpp
        ${CMAKE_SOURCE_DIR}/test/t/*/writer_test_cases.cpp
        ${CMAKE_SOURCE_DIR}/test/unit/*.cpp
        ${CMAKE_SOURCE_DIR}/tools/*.cpp
    )
    add_dependencies(clang-tidy writer_tests)
else()
    message(STATUS "Looking for clang-tidy - not found")
    message(STATUS "  Build target 'clang-tidy' will not be available.")
endif()

kelteseth avatar Jan 24 '22 08:01 kelteseth

This was fixed in #111

elfprince13 avatar Jul 21 '22 20:07 elfprince13