Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration error when tests are disabled but clang_tidy is found #109

Open
kelteseth opened this issue Jan 24, 2022 · 1 comment · May be fixed by #110
Open

Configuration error when tests are disabled but clang_tidy is found #109

kelteseth opened this issue Jan 24, 2022 · 1 comment · May be fixed by #110

Comments

@kelteseth
Copy link

kelteseth commented Jan 24, 2022

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()

ffontaine added a commit to ffontaine/protozero that referenced this issue Feb 16, 2022
Don't check for protobuf if tests are disabled. As a side effect, this
will avoid a build failure if clang-tidy and protobuf are found but
tests are disabled

Fix mapbox#109

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
@ffontaine ffontaine linked a pull request Feb 16, 2022 that will close this issue
@elfprince13
Copy link
Contributor

This was fixed in #111

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants