From: Maksym Mamontov Date: Sat, 30 Jul 2022 21:16:14 +0000 (+0300) Subject: Add instrumentation. X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/90b793eb07dc190eeb1144a1da079de760d17c36?ds=sidebyside;hp=fca49a45944d877965930a623fff27a84257782c Add instrumentation. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 6263a243..7e8fd09a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -101,6 +101,40 @@ if ( BUILD_MOD_SMUX OR BUILD_ALL_LIBS ) set ( BUILD_LIB_SMUX ON ) endif ( BUILD_MOD_SMUX OR BUILD_ALL_LIBS ) +if ( TIDY ) + find_program( CLANG_TIDY_EXE NAMES "clang-tidy" DOC "Path to clang-tidy executable" ) + if ( NOT CLANG_TIDY_EXE ) + message( STATUS "clang-tidy not found." ) + else () + message( STATUS "clang-tidy found: ${CLANG_TIDY_EXE}" ) + set( DO_CLANG_TIDY "${CLANG_TIDY_EXE}" + "-checks=-*,\ +clang-analyzer-*,\ +misc-*,\ +modernize-*,\ +performance-*,\ +portability-*,\ +readability-*,\ +bugprone-*,\ +-modernize-avoid-bind,\ +-modernize-use-trailing-return-type,\ +-readability-braces-around-statements, \ +-readability-magic-numbers, \ +-readability-identifier-length, \ +-bugprone-easily-swappable-parameters" ) + endif () +endif () + +if ( IWYU ) + find_program( INCLUDE_WHAT_YOU_USE_EXE NAMES "include-what-you-use" DOC "Path to include-what-you-use executable" ) + if ( NOT INCLUDE_WHAT_YOU_USE_EXE ) + message( STATUS "include-what-you-use not found." ) + else () + message( STATUS "include-what-you-use found: ${INCLUDE_WHAT_YOU_USE_EXE}" ) + set( DO_INCLUDE_WHAT_YOU_USE "${INCLUDE_WHAT_YOU_USE_EXE}" ) + endif () +endif () + enable_language (CXX) set (CMAKE_CXX_STANDARD 17) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W -Wall -Wextra -Wshadow -Wno-long-long -Wold-style-cast -Wstrict-aliasing -pedantic") diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt index 7d971315..41dc9785 100644 --- a/libs/CMakeLists.txt +++ b/libs/CMakeLists.txt @@ -5,49 +5,112 @@ if ( BUILD_LIB_COMMON ) add_library ( common STATIC common/blockio.cpp common/common.cpp common/strptime.cpp ) target_include_directories ( common PUBLIC common/include ) target_link_libraries ( common Iconv::Iconv ) + + if ( CLANG_TIDY_EXE ) + set_target_properties ( common PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" ) + endif () + if ( INCLUDE_WHAT_YOU_USE_EXE ) + set_target_properties ( common PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" ) + endif () endif ( BUILD_LIB_COMMON ) if ( BUILD_LIB_CONFFILES ) add_library ( conffiles STATIC conffiles/conffiles.cpp ) target_include_directories ( conffiles PUBLIC conffiles/include ) + + if ( CLANG_TIDY_EXE ) + set_target_properties ( conffiles PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" ) + endif () + if ( INCLUDE_WHAT_YOU_USE_EXE ) + set_target_properties ( conffiles PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" ) + endif () endif ( BUILD_LIB_CONFFILES ) if ( BUILD_LIB_CRYPTO ) add_library ( crypto STATIC crypto/ag_md5.c crypto/bfstream.cpp crypto/blowfish.c ) target_include_directories ( crypto PUBLIC crypto/include ) + + if ( CLANG_TIDY_EXE ) + set_target_properties ( crypto PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" ) + endif () + if ( INCLUDE_WHAT_YOU_USE_EXE ) + set_target_properties ( crypto PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" ) + endif () endif ( BUILD_LIB_CRYPTO ) if ( BUILD_LIB_DOTCONFPP ) add_library ( dotconfpp STATIC dotconfpp/dotconfpp.cpp dotconfpp/mempool.cpp ) target_include_directories ( dotconfpp PUBLIC dotconfpp/include ) + + if ( CLANG_TIDY_EXE ) + set_target_properties ( dotconfpp PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" ) + endif () + if ( INCLUDE_WHAT_YOU_USE_EXE ) + set_target_properties ( dotconfpp PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" ) + endif () endif ( BUILD_LIB_DOTCONFPP ) if ( BUILD_LIB_IA ) add_library ( ia STATIC ia/ia.cpp ) target_include_directories ( ia PUBLIC ia/include ) target_link_libraries ( ia crypto common ) + + if ( CLANG_TIDY_EXE ) + set_target_properties ( ia PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" ) + endif () + if ( INCLUDE_WHAT_YOU_USE_EXE ) + set_target_properties ( ia PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" ) + endif () endif ( BUILD_LIB_IA ) #if ( BUILD_LIB_IBPP ) # add_library ( ibpp STATIC ibpp/all_in_one.cpp ) # target_include_directories ( ibpp PUBLIC ibpp/include ) # target_compile_options ( ibpp PRIVATE -Wno-old-style-cast $<$:-Wno-useless-cast> ) +# +# if ( CLANG_TIDY_EXE ) +# set_target_properties ( ibpp PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" ) +# endif () +# if ( INCLUDE_WHAT_YOU_USE_EXE ) +# set_target_properties ( ibpp PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" ) +# endif () #endif ( BUILD_LIB_IBPP ) if ( BUILD_LIB_LOGGER ) add_library ( logger STATIC logger/logger.cpp ) target_include_directories ( logger PUBLIC logger/include ) + + if ( CLANG_TIDY_EXE ) + set_target_properties ( logger PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" ) + endif () + if ( INCLUDE_WHAT_YOU_USE_EXE ) + set_target_properties ( logger PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" ) + endif () endif ( BUILD_LIB_LOGGER ) if ( BUILD_LIB_PINGER ) add_library ( pinger STATIC pinger/pinger.cpp ) target_include_directories ( pinger PUBLIC pinger/include ) target_link_libraries ( pinger common ) + + if ( CLANG_TIDY_EXE ) + set_target_properties ( pinger PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" ) + endif () + if ( INCLUDE_WHAT_YOU_USE_EXE ) + set_target_properties ( pinger PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" ) + endif () endif ( BUILD_LIB_PINGER ) if ( BUILD_LIB_SCRIPTEXECUTER ) add_library ( scriptexecuter STATIC scriptexecuter/scriptexecuter.c ) target_include_directories ( scriptexecuter PUBLIC scriptexecuter/include ) + + if ( CLANG_TIDY_EXE ) + set_target_properties ( scriptexecuter PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" ) + endif () + if ( INCLUDE_WHAT_YOU_USE_EXE ) + set_target_properties ( scriptexecuter PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" ) + endif () endif ( BUILD_LIB_SCRIPTEXECUTER ) if ( BUILD_LIB_SMUX ) @@ -55,6 +118,13 @@ if ( BUILD_LIB_SMUX ) add_library ( smux STATIC ${SMUX_C_FILES} ) target_include_directories ( smux PUBLIC smux/include smux/include/stg ) target_compile_options ( smux PRIVATE -Wno-cpp ) + + if ( CLANG_TIDY_EXE ) + set_target_properties ( smux PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" ) + endif () + if ( INCLUDE_WHAT_YOU_USE_EXE ) + set_target_properties ( smux PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" ) + endif () endif ( BUILD_LIB_SMUX ) if ( BUILD_LIB_SRVCONF ) @@ -63,4 +133,11 @@ if ( BUILD_LIB_SRVCONF ) add_library ( srvconf STATIC srvconf/servconf.cpp srvconf/netunit.cpp ${PARSERS} ) target_include_directories ( srvconf PUBLIC srvconf/include ) target_link_libraries ( srvconf crypto common EXPAT::EXPAT ) + + if ( CLANG_TIDY_EXE ) + set_target_properties ( srvconf PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" ) + endif () + if ( INCLUDE_WHAT_YOU_USE_EXE ) + set_target_properties ( srvconf PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" ) + endif () endif ( BUILD_LIB_SRVCONF ) diff --git a/projects/rscriptd/CMakeLists.txt b/projects/rscriptd/CMakeLists.txt index 9228b370..b225a2a3 100644 --- a/projects/rscriptd/CMakeLists.txt +++ b/projects/rscriptd/CMakeLists.txt @@ -7,4 +7,11 @@ add_executable ( rscriptd ${CPP_FILES} ) target_link_libraries ( rscriptd scriptexecuter conffiles logger crypto common Threads::Threads ) +if ( CLANG_TIDY_EXE ) + set_target_properties ( rscriptd PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" ) +endif () +if ( INCLUDE_WHAT_YOU_USE_EXE ) + set_target_properties ( rscriptd PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" ) +endif () + # TODO: install diff --git a/projects/sgauth/CMakeLists.txt b/projects/sgauth/CMakeLists.txt index 2a87f3f6..ad82b1bf 100644 --- a/projects/sgauth/CMakeLists.txt +++ b/projects/sgauth/CMakeLists.txt @@ -15,4 +15,11 @@ add_executable ( sgauth ${CPP_FILES} ) target_link_libraries ( sgauth conffiles ia crypto common ${Intl_LIBRARIES} Threads::Threads ) +if ( CLANG_TIDY_EXE ) + set_target_properties ( sgauth PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" ) +endif () +if ( INCLUDE_WHAT_YOU_USE_EXE ) + set_target_properties ( sgauth PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" ) +endif () + # TODO: install diff --git a/projects/sgconf/CMakeLists.txt b/projects/sgconf/CMakeLists.txt index c2666b80..bdd95d07 100644 --- a/projects/sgconf/CMakeLists.txt +++ b/projects/sgconf/CMakeLists.txt @@ -9,4 +9,11 @@ add_executable ( sgconf ${CPP_FILES} ) target_link_libraries ( sgconf srvconf crypto common EXPAT::EXPAT ) +if ( CLANG_TIDY_EXE ) + set_target_properties ( sgconf PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" ) +endif () +if ( INCLUDE_WHAT_YOU_USE_EXE ) + set_target_properties ( sgconf PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" ) +endif () + # TODO: install diff --git a/projects/stargazer/CMakeLists.txt b/projects/stargazer/CMakeLists.txt index 073c7165..005e72df 100644 --- a/projects/stargazer/CMakeLists.txt +++ b/projects/stargazer/CMakeLists.txt @@ -23,6 +23,13 @@ add_executable ( stargazer ${CPP_FILES} ) target_link_libraries ( stargazer scriptexecuter dotconfpp logger common Threads::Threads ${CMAKE_DL_LIBS} ) +if ( CLANG_TIDY_EXE ) + set_target_properties ( stargazer PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" ) +endif () +if ( INCLUDE_WHAT_YOU_USE_EXE ) + set_target_properties ( stargazer PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" ) +endif () + add_subdirectory ( plugins ) # TODO: install diff --git a/projects/stargazer/plugins/CMakeLists.txt b/projects/stargazer/plugins/CMakeLists.txt index 9f16024b..c30f92cf 100644 --- a/projects/stargazer/plugins/CMakeLists.txt +++ b/projects/stargazer/plugins/CMakeLists.txt @@ -2,6 +2,13 @@ if ( BUILD_MOD_AO ) add_library ( mod_auth_ao MODULE authorization/ao/ao.cpp ) target_link_libraries ( mod_auth_ao scriptexecuter logger common ) set_target_properties ( mod_auth_ao PROPERTIES PREFIX "" ) + + if ( CLANG_TIDY_EXE ) + set_target_properties ( mod_auth_ao PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" ) + endif () + if ( INCLUDE_WHAT_YOU_USE_EXE ) + set_target_properties ( mod_auth_ao PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" ) + endif () endif ( BUILD_MOD_AO ) if ( BUILD_MOD_IA ) @@ -11,30 +18,65 @@ if ( BUILD_MOD_IA ) if ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" ) set_target_properties ( mod_auth_ia PROPERTIES LINK_FLAGS "-undefined dynamic_lookup" ) endif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" ) + + if ( CLANG_TIDY_EXE ) + set_target_properties ( mod_auth_ia PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" ) + endif () + if ( INCLUDE_WHAT_YOU_USE_EXE ) + set_target_properties ( mod_auth_ia PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" ) + endif () endif ( BUILD_MOD_IA ) if ( BUILD_MOD_CAP_NF ) add_library ( mod_cap_nf MODULE capture/cap_nf/cap_nf.cpp ) target_link_libraries ( mod_cap_nf logger common ) set_target_properties ( mod_cap_nf PROPERTIES PREFIX "" ) + + if ( CLANG_TIDY_EXE ) + set_target_properties ( mod_cap_nf PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" ) + endif () + if ( INCLUDE_WHAT_YOU_USE_EXE ) + set_target_properties ( mod_cap_nf PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" ) + endif () endif ( BUILD_MOD_CAP_NF ) if ( BUILD_MOD_CAP_DIVERT ) add_library ( mod_cap_divert MODULE capture/divert_freebsd/divert_cap.cpp ) target_link_libraries ( mod_cap_divert logger common ) set_target_properties ( mod_cap_divert PROPERTIES PREFIX "" ) + + if ( CLANG_TIDY_EXE ) + set_target_properties ( mod_cap_divert PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" ) + endif () + if ( INCLUDE_WHAT_YOU_USE_EXE ) + set_target_properties ( mod_cap_divert PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" ) + endif () endif ( BUILD_MOD_CAP_DIVERT ) if ( BUILD_MOD_CAP_ETHER_FREEBSD ) add_library ( mod_cap_bpf MODULE capture/ether_freebsd/ether_cap.cpp ) target_link_libraries ( mod_cap_bpf logger common ) set_target_properties ( mod_cap_bpf PROPERTIES PREFIX "" ) + + if ( CLANG_TIDY_EXE ) + set_target_properties ( mod_cap_bpf PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" ) + endif () + if ( INCLUDE_WHAT_YOU_USE_EXE ) + set_target_properties ( mod_cap_bpf PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" ) + endif () endif ( BUILD_MOD_CAP_ETHER_FREEBSD ) if ( BUILD_MOD_CAP_ETHER_LINUX ) add_library ( mod_cap_ether MODULE capture/ether_linux/ether_cap.cpp ) target_link_libraries ( mod_cap_ether logger common ) set_target_properties ( mod_cap_ether PROPERTIES PREFIX "" ) + + if ( CLANG_TIDY_EXE ) + set_target_properties ( mod_cap_ether PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" ) + endif () + if ( INCLUDE_WHAT_YOU_USE_EXE ) + set_target_properties ( mod_cap_ether PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" ) + endif () endif ( BUILD_MOD_CAP_ETHER_LINUX ) if ( BUILD_MOD_CAP_PCAP ) @@ -42,6 +84,13 @@ if ( BUILD_MOD_CAP_PCAP ) add_library ( mod_cap_pcap MODULE capture/pcap/pcap_cap.cpp ) target_link_libraries ( mod_cap_pcap logger common PCap::PCap ) set_target_properties ( mod_cap_pcap PROPERTIES PREFIX "" ) + + if ( CLANG_TIDY_EXE ) + set_target_properties ( mod_cap_pcap PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" ) + endif () + if ( INCLUDE_WHAT_YOU_USE_EXE ) + set_target_properties ( mod_cap_pcap PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" ) + endif () endif ( BUILD_MOD_CAP_PCAP ) if ( BUILD_MOD_CAP_NFQUEUE ) @@ -51,6 +100,13 @@ if ( BUILD_MOD_CAP_NFQUEUE ) add_library ( mod_cap_nfqueue MODULE capture/nfqueue/nfqueue.cpp ) target_link_libraries ( mod_cap_nfqueue logger common NF::Queue NF::NetLink MNL::MNL ) set_target_properties ( mod_cap_nfqueue PROPERTIES PREFIX "" ) + + if ( CLANG_TIDY_EXE ) + set_target_properties ( mod_cap_nfqueue PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" ) + endif () + if ( INCLUDE_WHAT_YOU_USE_EXE ) + set_target_properties ( mod_cap_nfqueue PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" ) + endif () endif ( BUILD_MOD_CAP_NFQUEUE ) if ( BUILD_MOD_SGCONFIG ) @@ -72,6 +128,13 @@ if ( BUILD_MOD_SGCONFIG ) if ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" ) set_target_properties ( mod_conf_sg PROPERTIES LINK_FLAGS "-undefined dynamic_lookup" ) endif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" ) + + if ( CLANG_TIDY_EXE ) + set_target_properties ( mod_conf_sg PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" ) + endif () + if ( INCLUDE_WHAT_YOU_USE_EXE ) + set_target_properties ( mod_conf_sg PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" ) + endif () endif ( BUILD_MOD_SGCONFIG ) if ( BUILD_MOD_RPCCONFIG ) @@ -87,12 +150,26 @@ if ( BUILD_MOD_RPCCONFIG ) configuration/rpcconfig/messages_methods.cpp ) target_link_libraries ( mod_conf_rpc scriptexecuter logger common ${XMLRPC_LIBRARIES} ) set_target_properties ( mod_conf_rpc PROPERTIES PREFIX "" ) + + if ( CLANG_TIDY_EXE ) + set_target_properties ( mod_conf_rpc PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" ) + endif () + if ( INCLUDE_WHAT_YOU_USE_EXE ) + set_target_properties ( mod_conf_rpc PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" ) + endif () endif ( BUILD_MOD_RPCCONFIG ) if ( BUILD_MOD_PING ) add_library ( mod_ping MODULE other/ping/ping.cpp ) target_link_libraries ( mod_ping scriptexecuter logger pinger common ) set_target_properties ( mod_ping PROPERTIES PREFIX "" ) + + if ( CLANG_TIDY_EXE ) + set_target_properties ( mod_ping PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" ) + endif () + if ( INCLUDE_WHAT_YOU_USE_EXE ) + set_target_properties ( mod_ping PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" ) + endif () endif ( BUILD_MOD_PING ) if ( BUILD_MOD_RSCRYPT ) @@ -102,6 +179,13 @@ if ( BUILD_MOD_RSCRYPT ) if ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" ) set_target_properties ( mod_remote_script PROPERTIES LINK_FLAGS "-undefined dynamic_lookup" ) endif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" ) + + if ( CLANG_TIDY_EXE ) + set_target_properties ( mod_remote_script PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" ) + endif () + if ( INCLUDE_WHAT_YOU_USE_EXE ) + set_target_properties ( mod_remote_script PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" ) + endif () endif ( BUILD_MOD_RSCRYPT ) if ( BUILD_MOD_SMUX ) @@ -113,12 +197,26 @@ if ( BUILD_MOD_SMUX ) other/smux/types.cpp ) target_link_libraries ( mod_smux scriptexecuter logger smux common ) set_target_properties ( mod_smux PROPERTIES PREFIX "" ) + + if ( CLANG_TIDY_EXE ) + set_target_properties ( mod_smux PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" ) + endif () + if ( INCLUDE_WHAT_YOU_USE_EXE ) + set_target_properties ( mod_smux PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" ) + endif () endif ( BUILD_MOD_SMUX ) if ( BUILD_MOD_STORE_FILES ) add_library ( mod_store_files MODULE store/files/file_store.cpp ) target_link_libraries ( mod_store_files crypto conffiles logger common ) set_target_properties ( mod_store_files PROPERTIES PREFIX "" ) + + if ( CLANG_TIDY_EXE ) + set_target_properties ( mod_store_files PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" ) + endif () + if ( INCLUDE_WHAT_YOU_USE_EXE ) + set_target_properties ( mod_store_files PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" ) + endif () endif ( BUILD_MOD_STORE_FILES ) #if ( BUILD_MOD_STORE_FIREBIRD ) @@ -133,6 +231,13 @@ endif ( BUILD_MOD_STORE_FILES ) # store/firebird/firebird_store_utils.cpp ) # target_link_libraries ( mod_store_firebird crypto common logger ibpp FBClient::FBClient ) # set_target_properties ( mod_store_firebird PROPERTIES PREFIX "" ) +# +# if ( CLANG_TIDY_EXE ) +# set_target_properties ( mod_store_firebird PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" ) +# endif () +# if ( INCLUDE_WHAT_YOU_USE_EXE ) +# set_target_properties ( mod_store_firebird PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" ) +# endif () #endif ( BUILD_MOD_STORE_FIREBIRD ) if ( BUILD_MOD_STORE_MYSQL ) @@ -140,6 +245,13 @@ if ( BUILD_MOD_STORE_MYSQL ) add_library ( mod_store_mysql MODULE store/mysql/mysql_store.cpp ) target_link_libraries ( mod_store_mysql crypto logger common MySQL::Connector ) set_target_properties ( mod_store_mysql PROPERTIES PREFIX "" ) + + if ( CLANG_TIDY_EXE ) + set_target_properties ( mod_store_mysql PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" ) + endif () + if ( INCLUDE_WHAT_YOU_USE_EXE ) + set_target_properties ( mod_store_mysql PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" ) + endif () endif ( BUILD_MOD_STORE_MYSQL ) if ( BUILD_MOD_STORE_POSTGRESQL ) @@ -155,4 +267,11 @@ if ( BUILD_MOD_STORE_POSTGRESQL ) store/postgresql/postgresql_store_utils.cpp ) target_link_libraries ( mod_store_postgresql crypto logger common ${PostgreSQL_LIBRARIES} ) set_target_properties ( mod_store_postgresql PROPERTIES PREFIX "" ) + + if ( CLANG_TIDY_EXE ) + set_target_properties ( mod_store_postgresql PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" ) + endif () + if ( INCLUDE_WHAT_YOU_USE_EXE ) + set_target_properties ( mod_store_postgresql PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" ) + endif () endif ( BUILD_MOD_STORE_POSTGRESQL )