aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil/wmem/CMakeLists.txt
diff options
context:
space:
mode:
authorJoão Valverde <j@v6e.pt>2021-07-12 21:22:05 +0100
committerWireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2021-07-26 14:56:11 +0000
commit7f9c1f5f92c131354fc8b2b88d473706786064c0 (patch)
tree9249c0eda50dea18e8b85e8aeb8c1d3c98a007cb /wsutil/wmem/CMakeLists.txt
parent8310665ae707b589e04167ef9bd2aed6f71651f3 (diff)
Move wmem to wsutil
This allows wmem to be used from other libraries, namely wsutil. It is often the case that a funtion exists in wsutil and cannot be used with a wmem scope, requiring some code duplication or extra memory allocations, or vice-versa, code in epan cannot be moved to wsutil because it has a wmem dependency. To this end wmem is moved to wsutil. Scope management remains part of epan because those scope semantics are specific to dissection.
Diffstat (limited to 'wsutil/wmem/CMakeLists.txt')
-rw-r--r--wsutil/wmem/CMakeLists.txt115
1 files changed, 115 insertions, 0 deletions
diff --git a/wsutil/wmem/CMakeLists.txt b/wsutil/wmem/CMakeLists.txt
new file mode 100644
index 0000000000..d3d4e88db5
--- /dev/null
+++ b/wsutil/wmem/CMakeLists.txt
@@ -0,0 +1,115 @@
+# CMakeLists.txt
+#
+# Wireshark - Network traffic analyzer
+# By Gerald Combs <gerald@wireshark.org>
+# Copyright 1998 Gerald Combs
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+
+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_stack.h
+ wmem_strbuf.h
+ wmem_strutl.h
+ wmem_tree.h
+ wmem_interval_tree.h
+ wmem_user_cb.h
+)
+
+set(WMEM_HEADER_FILES
+ ${WMEM_PUBLIC_HEADERS}
+ wmem_allocator.h
+ wmem_allocator_block.h
+ wmem_allocator_block_fast.h
+ wmem_allocator_simple.h
+ wmem_allocator_strict.h
+ wmem_interval_tree.h
+ wmem_map_int.h
+ wmem_tree-int.h
+ wmem_user_cb_int.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_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
+ #Included so that Visual Studio can properly put header files in solution
+ ${WMEM_HEADER_FILES}
+
+ ${WMEM_FILES}
+)
+
+target_include_directories(wmem
+ PRIVATE
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}
+)
+
+set_target_properties(wmem PROPERTIES
+ FOLDER "Libs/wsutil/wmem"
+ COMPILE_DEFINITIONS "WS_BUILD_DLL"
+)
+
+add_executable(wmem_test EXCLUDE_FROM_ALL wmem_test.c $<TARGET_OBJECTS:wmem>)
+
+target_link_libraries(wmem_test wsutil)
+
+set_target_properties(wmem_test PROPERTIES
+ FOLDER "Tests"
+ EXCLUDE_FROM_DEFAULT_BUILD True
+ COMPILE_DEFINITIONS "WS_BUILD_DLL"
+)
+
+install(FILES ${WMEM_PUBLIC_HEADERS}
+ DESTINATION "${PROJECT_INSTALL_INCLUDEDIR}/wsutil/wmem"
+)
+
+CHECKAPI(
+ NAME
+ wmem
+ SWITCHES
+ SOURCES
+ ${WMEM_FILES}
+)
+
+#
+# Editor modelines - https://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:
+#