arcolight commented on code in PR #7538:
URL: https://github.com/apache/ignite-3/pull/7538#discussion_r2799257853
##########
modules/platforms/cpp/CMakeLists.txt:
##########
@@ -63,6 +65,58 @@ if(ENABLE_IWYU)
set(CMAKE_C_INCLUDE_WHAT_YOU_USE ${IWYU_PATH})
endif()
+if(ENABLE_CLANG_TIDY)
+ find_program(CLANG_TIDY_BIN clang-tidy REQUIRED)
+ if(CLANG_TIDY_BIN)
+ message(STATUS "clang-tidy: ${CLANG_TIDY_BIN}")
+ set(CMAKE_CXX_CLANG_TIDY ${CLANG_TIDY_BIN}
+
"--checks=-*,clang-analyzer-*,clang-analyzer-cplusplus*,bugprone*,concurrency-*,cppcoreguidelines-*,performance-*,portability-*,readability-*"
+
"--header-filter=\"^.*(client|common|network|odbc|protocol|tuple).*\"gm"
+ "--exclude-header-filter=\"^.*(build|tests).*\"gm")
+ set(CMAKE_CXX_CLANG_TIDY_EXPORT_FIXES_DIR "clang-tidy-reports-dir")
+ else()
+ message(STATUS "clang-tidy not found!")
+ endif()
+endif()
+
+if(ENABLE_CPPCHECK)
+ find_program(CPPCHECK_BIN cppcheck REQUIRED)
+ if(CPPCHECK_BIN)
+ message(STATUS "cppcheck: ${CPPCHECK_BIN}")
+ message(STATUS "Please do not use parallel build with cppcheck
enabled! Cppcheck writes results to the file and result might be corrupted in
case of parallel build.")
+ set(CMAKE_CXX_CPPCHECK ${CPPCHECK_BIN} --enable=all --xml
--xml-version=3 --output-file=cppcheck_report.xml)
+ add_custom_target(cppcheck_html_report ALL
+ COMMAND cppcheck-htmlreport
+ --file
${CMAKE_CURRENT_BINARY_DIR}/ignite/tuple/cppcheck_report.xml
+ --file
${CMAKE_CURRENT_BINARY_DIR}/ignite/protocol/cppcheck_report.xml
+ --file
${CMAKE_CURRENT_BINARY_DIR}/ignite/common/cppcheck_report.xml
+ --file
${CMAKE_CURRENT_BINARY_DIR}/ignite/network/cppcheck_report.xml
+ $<$<BOOL:${ENABLE_TESTS}>:--file
${CMAKE_CURRENT_BINARY_DIR}/tests/client-test/cppcheck_report.xml>
+ $<$<BOOL:${ENABLE_TESTS}>:--file
${CMAKE_CURRENT_BINARY_DIR}/tests/fake_server/cppcheck_report.xml>
+ $<$<BOOL:${ENABLE_TESTS}>:--file
${CMAKE_CURRENT_BINARY_DIR}/tests/odbc-test/cppcheck_report.xml>
+ $<$<BOOL:${ENABLE_TESTS}>:--file
${CMAKE_CURRENT_BINARY_DIR}/tests/test-common/cppcheck_report.xml>
+ $<$<BOOL:${ENABLE_ODBC}>:--file
${CMAKE_CURRENT_BINARY_DIR}/ignite/odbc/cppcheck_report.xml>
+ $<$<BOOL:${ENABLE_CLIENT}>:--file
${CMAKE_CURRENT_BINARY_DIR}/ignite/client/cppcheck_report.xml>
+ --report-dir=${CMAKE_CURRENT_BINARY_DIR}/cppcheck_report
+ DEPENDS
+ ignite-tuple
+ ignite-protocol
+ ignite-common
+ ignite-network
Review Comment:
Ok, it is true. Fixed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]