wireshark/epan/wmem/CMakeLists.txt

105 lines
1.8 KiB
CMake
Raw Normal View History

# CMakeLists.txt
#
# Wireshark - Network traffic analyzer
# By Gerald Combs <gerald@wireshark.org>
# Copyright 1998 Gerald Combs
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
)
set(WMEM_PUBLIC_HEADERS
wmem.h
wmem_array.h
wmem_core.h
wmem_list.h
wmem_map.h
wmem_miscutl.h
wmem_queue.h
wmem_scopes.h
wmem_stack.h
wmem_strbuf.h
wmem_strutl.h
wmem_tree.h
wmem_interval_tree.h
wmem_user_cb.h
)
set(WMEM_FILES
wmem_array.c
wmem_core.c
wmem_allocator_block.c
wmem_allocator_block_fast.c
wmem_allocator_simple.c
wmem_allocator_strict.c
wmem_interval_tree.c
wmem_list.c
wmem_map.c
wmem_miscutl.c
wmem_scopes.c
wmem_stack.c
wmem_strbuf.c
wmem_strutl.c
wmem_tree.c
wmem_user_cb.c
)
source_group(wmem FILES ${WMEM_FILES})
set_source_files_properties(
${WMEM_FILES}
PROPERTIES
COMPILE_FLAGS "${WERROR_COMMON_FLAGS}"
)
add_library(wmem OBJECT
${WMEM_FILES}
)
set_target_properties(wmem PROPERTIES
FOLDER "Libs/epan/wmem"
COMPILE_DEFINITIONS "WS_BUILD_DLL"
)
add_executable(wmem_test EXCLUDE_FROM_ALL wmem_test.c $<TARGET_OBJECTS:wmem>)
Add string function times to wmem_test. The system, GLib, and wmem string functions can perform differently, particularly on Windows. Start adding performance tests to wmem_test so that we can see the differences. With this change applied "wmem_test --verbose" prints out the following on a Windows 7 x64 VM here. wmem_test is linked against GLib 2.4.20. (MINPERF:g_printf_string_upper_bound (via g_snprintf) 1 string: u 327.602 ms s 0 .000 ms) (MINPERF:g_printf_string_upper_bound (via g_snprintf) 5 strings: u 1419.609 ms s 0.000 ms) (MINPERF:g_printf_string_upper_bound (via g_snprintf) mixed args: u 1606.810 ms s 0.000 ms) (MINPERF:_snprintf_s upper bound 1 string: u 124.801 ms s 0.000 ms) (MINPERF:_snprintf_s upper bound 5 strings: u 140.401 ms s 0.000 ms) (MINPERF:_snprintf_s upper bound mixed args: u 124.801 ms s 0.000 ms) (MINPERF:g_strdup_printf 2 strings: u 702.005 ms s 0.156 ms) (MINPERF:g_strconcat 2 strings: u 78.000 ms s 0.000 ms) (MINPERF:g_strdup_printf 5 strings: u 1419.609 ms s 0.156 ms) (MINPERF:g_strconcat 5 strings: u 93.601 ms s 0.156 ms) (MINPERF:wmem_strdup_printf 2 strings: u 343.202 ms s 0.312 ms) (MINPERF:wmem_strconcat 2 strings: u 93.601 ms s 0.468 ms) (MINPERF:wmem_strdup_printf 5 strings: u 327.602 ms s 8.268 ms) (MINPERF:wmem_strconcat 5 strings: u 62.400 ms s 3.432 ms) Change-Id: Id9b23918829db1719d141e7f830b9eba6245a25b Reviewed-on: https://code.wireshark.org/review/14857 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-04-07 22:31:21 +00:00
target_link_libraries(wmem_test ${GLIB2_LIBRARIES} wsutil)
set_target_properties(wmem_test PROPERTIES
FOLDER "Tests"
EXCLUDE_FROM_DEFAULT_BUILD True
COMPILE_DEFINITIONS "WS_BUILD_DLL"
)
if(NOT WIN32)
install(FILES ${WMEM_PUBLIC_HEADERS}
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${CPACK_PACKAGE_NAME}/epan/wmem"
)
endif()
CHECKAPI(
NAME
wmem
SWITCHES
--group termoutput:1 --summary-group termoutput
--build
SOURCES
${WMEM_FILES}
)
#
# Editor modelines - http://www.wireshark.org/tools/modelines.html
#
# Local variables:
# c-basic-offset: 8
# tab-width: 8
# indent-tabs-mode: t
# End:
#
# vi: set shiftwidth=8 tabstop=8 noexpandtab:
# :indentSize=8:tabSize=8:noTabs=false:
#