From 7572299615b392560eb6d34de694f133bb82ca80 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Fri, 14 Sep 2018 10:49:13 +0200 Subject: [PATCH] enable clang-tidy for srslte_upper library --- CMakeLists.txt | 2 +- lib/src/upper/CMakeLists.txt | 5 +++++ lib/test/upper/CMakeLists.txt | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0c8f5a021..1e147d74e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -359,7 +359,7 @@ if(NOT CLANG_TIDY_BIN) message(STATUS "clang-tidy not found.") else() message(STATUS "clang-tidy found: ${CLANG_TIDY_BIN}") - set(DO_CLANG_TIDY "${CLANG_TIDY_BIN}" "-checks=*,-clang-analyzer-alpha.*") + set(DO_CLANG_TIDY "${CLANG_TIDY_BIN}" "-checks=*,-clang-analyzer-alpha.*,-modernize-*,-cppcoreguidelines-pro-type-vararg,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-bounds-constant-array-index") endif() diff --git a/lib/src/upper/CMakeLists.txt b/lib/src/upper/CMakeLists.txt index 725d6de60..4ba2ff951 100644 --- a/lib/src/upper/CMakeLists.txt +++ b/lib/src/upper/CMakeLists.txt @@ -22,3 +22,8 @@ file(GLOB SOURCES "*.cc") add_library(srslte_upper STATIC ${SOURCES}) target_link_libraries(srslte_upper srslte_common srslte_asn1) install(TARGETS srslte_upper DESTINATION ${LIBRARY_DIR}) + +# Run clang-tidy if available +if(CLANG_TIDY_BIN) + set_target_properties(srslte_upper PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}") +endif() \ No newline at end of file diff --git a/lib/test/upper/CMakeLists.txt b/lib/test/upper/CMakeLists.txt index e3fcd4f4b..66982463f 100644 --- a/lib/test/upper/CMakeLists.txt +++ b/lib/test/upper/CMakeLists.txt @@ -36,6 +36,11 @@ add_test(rlc_am_stress_test rlc_stress_test --mode=AM --loglevel 1 --sdu_gen_del add_test(rlc_um_stress_test rlc_stress_test --mode=UM --loglevel 1) add_test(rlc_tm_stress_test rlc_stress_test --mode=TM --loglevel 1 --opp_sdu_ratio=1.0) +# Run clang-tidy if available +if(CLANG_TIDY_BIN) + set_target_properties(rlc_stress_test PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}") +endif() + add_executable(rlc_um_data_test rlc_um_data_test.cc) target_link_libraries(rlc_um_data_test srslte_upper srslte_phy srslte_common) add_test(rlc_um_data_test rlc_um_data_test)