X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/907166f270d246529788a6de7688f3e54847c0a2..16e9905f82947dd471c09382122d8150ba6fda1a:/libs/CMakeLists.txt diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt index 8528b951..b2b8ee0f 100644 --- a/libs/CMakeLists.txt +++ b/libs/CMakeLists.txt @@ -5,67 +5,139 @@ 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 ) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-old-style-cast -Wno-useless-cast") add_library ( ibpp STATIC ibpp/all_in_one.cpp ) target_include_directories ( ibpp PUBLIC ibpp/include ) -endif ( BUILD_LIB_IBPP ) + target_compile_options ( ibpp PRIVATE -Wno-old-style-cast $<$:-Wno-useless-cast> ) -if ( BUILD_LIB_JSON ) - find_package ( YAJL REQUIRED ) - add_library ( json STATIC json/generator.cpp json/parser.cpp ) - target_include_directories ( json PUBLIC json/include ) - target_link_libraries ( json common YAJL::YAJL ) -endif ( BUILD_LIB_JSON ) + 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 ) file ( GLOB SMUX_C_FILES smux/*.c ) 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 ) + find_package ( EXPAT REQUIRED ) file ( GLOB PARSERS srvconf/parsers/*.cpp ) add_library ( srvconf STATIC srvconf/servconf.cpp srvconf/netunit.cpp ${PARSERS} ) target_include_directories ( srvconf PUBLIC srvconf/include ) - target_link_libraries ( srvconf crypto common ) + 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 )