X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/8e80bb9cec2c90dd61f810fb1525932a434288eb..296c906e2689b9b5dc26d2f2d3e1e2d9e1662d3b:/projects/stargazer/plugins/CMakeLists.txt diff --git a/projects/stargazer/plugins/CMakeLists.txt b/projects/stargazer/plugins/CMakeLists.txt index a8958c43..a53349ea 100644 --- a/projects/stargazer/plugins/CMakeLists.txt +++ b/projects/stargazer/plugins/CMakeLists.txt @@ -2,8 +2,48 @@ 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_RADIUS ) + find_package ( Boost REQUIRED ) + + add_library ( mod_radius MODULE other/radius/radius.cpp ) + target_link_libraries ( mod_radius PRIVATE scriptexecuter logger common ) + set_target_properties ( mod_radius PROPERTIES PREFIX "" ) + + include ( ExternalProject ) + + ExternalProject_Add ( async-radius + GIT_REPOSITORY https://github.com/madf/async-radius.git + GIT_TAG 1.1.0 + GIT_SHALLOW true + INSTALL_COMMAND "" + CMAKE_ARGS -DCMAKE_CXX_FLAGS=-fPIC ) + + ExternalProject_Get_property ( async-radius SOURCE_DIR BINARY_DIR ) + + target_include_directories ( mod_radius PRIVATE "${SOURCE_DIR}/include" ) + target_link_directories ( mod_radius PRIVATE "${BINARY_DIR}/src" ) + + add_dependencies ( mod_radius async-radius ) + + target_link_libraries ( mod_radius PRIVATE radproto Boost::boost ) + + if ( CLANG_TIDY_EXE ) + set_target_properties ( mod_radius PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" ) + endif () + if ( INCLUDE_WHAT_YOU_USE_EXE ) + set_target_properties ( mod_radius PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" ) + endif () +endif ( BUILD_MOD_RADIUS ) + if ( BUILD_MOD_IA ) add_library ( mod_auth_ia MODULE authorization/inetaccess/inetaccess.cpp ) target_link_libraries ( mod_auth_ia scriptexecuter crypto logger common ) @@ -11,30 +51,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 +117,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 +133,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,10 +161,22 @@ 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 ) - find_package ( XMLRPC REQUIRED c++ abyss-server ) + find_package ( XMLRPC 1.58.0 REQUIRED c++2 abyss-server ) + try_compile ( XMLRPC_C_NO_AUTO_PTR ${CMAKE_CURRENT_BINARY_DIR} "${PROJECT_SOURCE_DIR}/checks/xmlrpc-c-auto_ptr.cpp" CMAKE_FLAGS -DINCLUDE_DIRECTORIES=${XMLRPC_INCLUDE_DIRS} LINK_LIBRARIES ${XMLRPC_LIBRARIES} OUTPUT_VARIABLE TRY_COMPILE_OUTPUT ) + if ( NOT XMLRPC_C_NO_AUTO_PTR ) + message ( WARNING ${TRY_COMPILE_OUTPUT} ) + message ( FATAL_ERROR "Your version of XMLRPC-C library can not be used with C++17. Try upgrading to at least 1.58.0." ) + endif () include_directories ( ${XMLRPC_INCLUDE_DIRS} ) add_library ( mod_conf_rpc MODULE configuration/rpcconfig/rpcconfig.cpp configuration/rpcconfig/user_helper.cpp @@ -85,14 +186,31 @@ if ( BUILD_MOD_RPCCONFIG ) configuration/rpcconfig/tariffs_methods.cpp configuration/rpcconfig/admins_methods.cpp configuration/rpcconfig/messages_methods.cpp ) - target_link_libraries ( mod_conf_rpc scriptexecuter logger common ${XMLRPC_LIBRARIES} ) + target_link_libraries ( mod_conf_rpc scriptexecuter logger common ${XMLRPC_LIBRARIES} ) set_target_properties ( mod_conf_rpc PROPERTIES PREFIX "" ) + if ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" ) + set_target_properties ( mod_conf_rpc PROPERTIES LINK_FLAGS "-undefined dynamic_lookup" ) + endif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" ) + + 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 +220,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 +238,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 +272,13 @@ if ( BUILD_MOD_STORE_FIREBIRD ) 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 +286,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 +308,14 @@ 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 ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" ) + set_target_properties ( mod_store_postgresql PROPERTIES LINK_FLAGS "-undefined dynamic_lookup" ) + endif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" ) + + 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 )