diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-12-12 14:47:45 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-12-12 15:43:35 +0000 |
commit | 0a4f8e4121ac3ef00b93c9c99b3b943bdf195ce8 (patch) | |
tree | c78185f560a7f34f780033b2bb074e0f2dec7c6f /utils/CMakeLists.txt | |
parent | 5bb89372e9eed24a38c9caf768d7e43c4d8f3870 (diff) | |
download | rspamd-0a4f8e4121ac3ef00b93c9c99b3b943bdf195ce8.tar.gz rspamd-0a4f8e4121ac3ef00b93c9c99b3b943bdf195ce8.zip |
[Feature] Add a simple benchmark for content type parsing
Diffstat (limited to 'utils/CMakeLists.txt')
-rw-r--r-- | utils/CMakeLists.txt | 50 |
1 files changed, 22 insertions, 28 deletions
diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt index e0bb5c886..28ea43139 100644 --- a/utils/CMakeLists.txt +++ b/utils/CMakeLists.txt @@ -1,39 +1,33 @@ SET(UTILSERVERSRC rspamd_http_server.c) SET(UTILBENCHSRC rspamd_http_bench.c) SET(RECVBENCHSRC received_parser_bench.c) +SET(CTYPEBENCHSRC content_type_bench.c) -ADD_EXECUTABLE(rspamd-http-server ${UTILSERVERSRC}) -SET_TARGET_PROPERTIES(rspamd-http-server PROPERTIES LINKER_LANGUAGE C) -TARGET_LINK_LIBRARIES(rspamd-http-server rspamd-server) -TARGET_LINK_LIBRARIES(rspamd-http-server rspamd-http-parser) -TARGET_LINK_LIBRARIES(rspamd-http-server ${RSPAMD_REQUIRED_LIBRARIES}) +MACRO(ADD_UTIL NAME) + ADD_EXECUTABLE("${NAME}" "${ARGN}") + IF (ENABLE_HYPERSCAN MATCHES "ON") + SET_TARGET_PROPERTIES("${NAME}" PROPERTIES LINKER_LANGUAGE CXX) + ELSE() + SET_TARGET_PROPERTIES("${NAME}" PROPERTIES LINKER_LANGUAGE C) + ENDIF() + TARGET_LINK_LIBRARIES("${NAME}" rspamd-server) + IF (ENABLE_SNOWBALL MATCHES "ON") + TARGET_LINK_LIBRARIES("${NAME}" stemmer) + ENDIF() + IF(ENABLE_HIREDIS MATCHES "ON") + TARGET_LINK_LIBRARIES("${NAME}" rspamd-hiredis) + ENDIF() + TARGET_LINK_LIBRARIES("${NAME}" ${RSPAMD_REQUIRED_LIBRARIES}) +ENDMACRO() -ADD_EXECUTABLE(rspamd-http-bench ${UTILBENCHSRC}) -SET_TARGET_PROPERTIES(rspamd-http-bench PROPERTIES LINKER_LANGUAGE C) -TARGET_LINK_LIBRARIES(rspamd-http-bench rspamd-http-parser) -TARGET_LINK_LIBRARIES(rspamd-http-bench rspamd-server) -TARGET_LINK_LIBRARIES(rspamd-http-bench ${RSPAMD_REQUIRED_LIBRARIES}) - -ADD_EXECUTABLE(rspamd-received-bench ${RECVBENCHSRC}) -SET_TARGET_PROPERTIES(rspamd-received-bench PROPERTIES LINKER_LANGUAGE C) -TARGET_LINK_LIBRARIES(rspamd-received-bench rspamd-server) -IF (ENABLE_SNOWBALL MATCHES "ON") - TARGET_LINK_LIBRARIES(rspamd-received-bench stemmer) -ENDIF() -IF(ENABLE_HIREDIS MATCHES "ON") - TARGET_LINK_LIBRARIES(rspamd-received-bench rspamd-hiredis) -ENDIF() -TARGET_LINK_LIBRARIES(rspamd-received-bench ${RSPAMD_REQUIRED_LIBRARIES}) - -IF (ENABLE_HYPERSCAN MATCHES "ON") - SET_TARGET_PROPERTIES(rspamd-http-bench PROPERTIES LINKER_LANGUAGE CXX) - SET_TARGET_PROPERTIES(rspamd-http-server PROPERTIES LINKER_LANGUAGE CXX) - SET_TARGET_PROPERTIES(rspamd-received-bench PROPERTIES LINKER_LANGUAGE CXX) -ENDIF() +ADD_UTIL(rspamd-http-server ${UTILSERVERSRC}) +ADD_UTIL(rspamd-http-bench ${UTILBENCHSRC}) +ADD_UTIL(rspamd-received-bench ${RECVBENCHSRC}) +ADD_UTIL(rspamd-ctype-bench ${CTYPEBENCHSRC}) # Redirector IF (ENABLE_REDIRECTOR MATCHES "ON") CONFIGURE_FILE(redirector.pl.in redirector.pl @ONLY) INSTALL(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/redirector.pl" DESTINATION bin RENAME rspamd-redirector) -ENDIF (ENABLE_REDIRECTOR MATCHES "ON")
\ No newline at end of file +ENDIF (ENABLE_REDIRECTOR MATCHES "ON") |