From: Michael Wallner Date: Fri, 17 Jan 2020 07:54:27 +0000 (+0100) Subject: WiP cmake-ify X-Git-Tag: post_cmake~30 X-Git-Url: https://git.m6w6.name/?p=awesomized%2Flibmemcached;a=commitdiff_plain;h=cbb1b6155e959764f3d9915b7d98ed598384e0f6 WiP cmake-ify --- diff --git a/.gitignore b/.gitignore index 25348f7a..aa09fc4d 100644 --- a/.gitignore +++ b/.gitignore @@ -52,6 +52,7 @@ clients/memrm clients/memslap clients/memstat clients/memtouch +cmake-build-debug/ config.cache config.log config.status diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..d35aabd3 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,367 @@ +cmake_minimum_required(VERSION 3.9..3.16) + +if(${CMAKE_VERSION} VERSION_LESS 3.12) + cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}) +endif() + +project(libmemcached + VERSION 1.99 + DESCRIPTION "libmemcached https://github.com/m6w6/libmemcached" + ) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_POSITION_INDEPENDENT_CODE ON) + +include(Config.cmake) +include(Include.cmake) + +find_package(Threads REQUIRED) +find_library(HAVE_LIBSASL NAMES sasl sasl2) +check_header(sasl/sasl.h) + +check_header(arpa/inet.h) +check_header(dlfcn.h) +check_header(errno.h) +check_header(execinfo.h) +check_header(fcntl.h) +check_header(io.h) +check_header(limits.h) +check_header(netdb.h) +check_header(poll.h) +check_header(stddef.h) +check_header(stdlib.h) +check_header(strings.h) +check_header(sys/socket.h) +check_header(sys/time.h) +check_header(sys/types.h) +check_header(sys/un.h) +check_header(time.h) +check_header(umem.h) +check_header(unistd.h) +check_header(winsock2.h) +check_header(ws2tcpip.h) + +check_decl(fcntl fcntl.h) +check_decl(htonll arpa/inet.h) +check_decl(MSG_DONTWAIT sys/socket.h) +check_decl(MSG_MORE sys/socket.h) +check_decl(MSG_NOSIGNAL sys/socket.h) +check_decl(rcvtimeo sys/socket.h) +check_decl(sndtimeo sys/socket.h) +check_decl(strerror_r string.h) +check_decl(strerror string.h) +check_decl(abi::__cxa_demangle cxxabi.h) +set(HAVE_GCC_ABI_DEMANGLE ${HAVE_ABI____CXA_DEMANGLE}) + +check_type(in_port_t netinet/in.h) + +check_header(cstdint) +check_header(cinttypes) + +check_debug() + +configure_file(mem_config.h.in ${CMAKE_BINARY_DIR}/mem_config.h @ONLY) + +include_directories(${CMAKE_BINARY_DIR}) + +add_subdirectory(clients) +add_subdirectory(libhashkit) +add_subdirectory(libhashkit-1.0) +add_subdirectory(libmemcached) +add_subdirectory(libmemcached-1.0) +add_subdirectory(libmemcachedinternal) +add_subdirectory(libmemcachedutil) + + + + + + + + + + + + + + + + + + +include_directories(${CMAKE_BINARY_DIR}) +include_directories(.) +include_directories(clients) +include_directories(example) +include_directories(libhashkit) +include_directories(libhashkit-1.0) +include_directories(libmemcached) +include_directories(libmemcached/csl) +include_directories(libmemcached/memcached) +include_directories(libmemcached-1.0) +include_directories(libmemcached-1.0/struct) +include_directories(libmemcached-1.0/types) +include_directories(libmemcachedprotocol) +include_directories(libmemcachedprotocol-0.0) +include_directories(libmemcachedutil) +include_directories(libmemcachedutil-1.0) +include_directories(libtest) +include_directories(libtest/exception) +include_directories(libtest/result) +include_directories(tests) +include_directories(tests/libmemcached-1.0) +include_directories(util) +include_directories(win32) + + +if (FALSE) + add_executable(nope + example/byteorder.cc + example/byteorder.h + example/interface_v0.cc + example/interface_v1.cc + example/memcached_light.cc + example/memcached_light.h + example/storage.cc + example/storage.h + + + libmemcached-1.0/t/c_sasl_test.c + libmemcached-1.0/t/c_test.c + libmemcached-1.0/t/cc_test.cc + + libmemcachedprotocol/ascii_handler.c + libmemcachedprotocol/ascii_handler.h + libmemcachedprotocol/binary_handler.c + libmemcachedprotocol/binary_handler.h + libmemcachedprotocol/cache.c + libmemcachedprotocol/cache.h + libmemcachedprotocol/common.h + libmemcachedprotocol/handler.c + libmemcachedprotocol/pedantic.c + libmemcachedprotocol-0.0/binary.h + libmemcachedprotocol-0.0/callback.h + libmemcachedprotocol-0.0/handler.h + libmemcachedprotocol-0.0/vbucket.h + + libmemcachedutil/common.h + + libmemcachedutil-1.0/flush.h + libmemcachedutil-1.0/ostream.hpp + libmemcachedutil-1.0/pid.h + libmemcachedutil-1.0/ping.h + libmemcachedutil-1.0/pool.h + libmemcachedutil-1.0/util.h + libmemcachedutil-1.0/version.h + + libtest/exception/disconnected.hpp + libtest/exception/fatal.cc + libtest/exception/fatal.hpp + libtest/result/base.hpp + libtest/result/fail.hpp + libtest/result/skip.hpp + libtest/result/success.hpp + libtest/abort.cc + libtest/alarm.cc + libtest/alarm.h + libtest/backtrace_test.cc + libtest/binaries.cc + libtest/binaries.h + libtest/blobslap_worker.cc + libtest/blobslap_worker.h + libtest/callbacks.h + libtest/client.cc + libtest/client.hpp + libtest/cmdline.cc + libtest/cmdline.h + libtest/collection.cc + libtest/collection.h + libtest/common.h + libtest/comparison.cc + libtest/comparison.hpp + libtest/core.cc + libtest/core.h + libtest/core_count.cc + libtest/cpu.cc + libtest/cpu.hpp + libtest/dns.cc + libtest/dns.hpp + libtest/dream.cc + libtest/dream.h + libtest/drizzled.cc + libtest/drizzled.h + libtest/error.h + libtest/exception.cc + libtest/exception.hpp + libtest/failed.cc + libtest/formatter.cc + libtest/formatter.hpp + libtest/framework.cc + libtest/framework.h + libtest/gearmand.cc + libtest/gearmand.h + libtest/get.h + libtest/has.cc + libtest/has.hpp + libtest/http.cc + libtest/http.hpp + libtest/is_local.cc + libtest/is_local.hpp + libtest/is_pid.hpp + libtest/killpid.cc + libtest/killpid.h + libtest/libtool.cc + libtest/libtool.hpp + libtest/lite.h + libtest/main.cc + libtest/memcached.cc + libtest/memcached.h + libtest/memcached.hpp + libtest/poll_error.hpp + libtest/port.cc + libtest/port.h + libtest/result.cc + libtest/result.hpp + libtest/runner.cc + libtest/runner.h + libtest/server.cc + libtest/server.h + libtest/server_container.cc + libtest/server_container.h + libtest/signal.cc + libtest/signal.h + libtest/skiptest.cc + libtest/socket.cc + libtest/socket.hpp + libtest/stream.h + libtest/strerror.cc + libtest/strerror.h + libtest/string.hpp + libtest/test.h + libtest/test.hpp + libtest/thread.hpp + libtest/timer.cc + libtest/timer.hpp + libtest/tmpfile.cc + libtest/tmpfile.hpp + libtest/unittest.cc + libtest/valgrind.h + libtest/vchar.cc + libtest/vchar.hpp + libtest/version.h + libtest/visibility.h + libtest/wait.cc + libtest/wait.h + libtest/yatl.h + libtest/yatlcon.h + + tests/libmemcached-1.0/all_tests.cc + tests/libmemcached-1.0/all_tests.h + tests/libmemcached-1.0/all_tests_socket.cc + tests/libmemcached-1.0/atomsmasher.cc + tests/libmemcached-1.0/basic.cc + tests/libmemcached-1.0/callback_counter.cc + tests/libmemcached-1.0/callback_counter.h + tests/libmemcached-1.0/callbacks.cc + tests/libmemcached-1.0/debug.cc + tests/libmemcached-1.0/deprecated.cc + tests/libmemcached-1.0/dump.cc + tests/libmemcached-1.0/dump.h + tests/libmemcached-1.0/encoding_key.cc + tests/libmemcached-1.0/encoding_key.h + tests/libmemcached-1.0/error_conditions.cc + tests/libmemcached-1.0/exist.cc + tests/libmemcached-1.0/fetch_all_results.cc + tests/libmemcached-1.0/fetch_all_results.h + tests/libmemcached-1.0/generate.cc + tests/libmemcached-1.0/generate.h + tests/libmemcached-1.0/haldenbrand.cc + tests/libmemcached-1.0/haldenbrand.h + tests/libmemcached-1.0/internals.cc + tests/libmemcached-1.0/ketama.cc + tests/libmemcached-1.0/mem_functions.cc + tests/libmemcached-1.0/mem_functions.h + tests/libmemcached-1.0/memcached_fetch_execute.cc + tests/libmemcached-1.0/memcached_fetch_execute.h + tests/libmemcached-1.0/memcached_get.cc + tests/libmemcached-1.0/memcached_get.h + tests/libmemcached-1.0/namespace.cc + tests/libmemcached-1.0/parser.cc + tests/libmemcached-1.0/parser.h + tests/libmemcached-1.0/plus.cpp + tests/libmemcached-1.0/pool.cc + tests/libmemcached-1.0/print.cc + tests/libmemcached-1.0/replication.cc + tests/libmemcached-1.0/sasl.cc + tests/libmemcached-1.0/server_add.cc + tests/libmemcached-1.0/setup_and_teardowns.cc + tests/libmemcached-1.0/setup_and_teardowns.h + tests/libmemcached-1.0/stat.cc + tests/libmemcached-1.0/stat.h + tests/libmemcached-1.0/string.cc + tests/libmemcached-1.0/touch.cc + tests/libmemcached-1.0/virtual_buckets.cc + tests/basic.h + tests/callbacks.h + tests/cpp_example.cc + tests/cycle.cc + tests/debug.h + tests/deprecated.h + tests/error_conditions.h + tests/exist.h + tests/failure.cc + tests/hash_plus.cc + tests/hash_results.h + tests/hashkit_functions.cc + tests/ketama.h + tests/ketama_test_cases.h + tests/ketama_test_cases_spy.h + tests/keys.hpp + tests/libmemcached_test_container.h + tests/libmemcached_world.h + tests/libmemcached_world_socket.h + tests/mem_udp.cc + tests/memc.hpp + tests/memcapable.cc + tests/memcat.cc + tests/memcp.cc + tests/memdump.cc + tests/memerror.cc + tests/memexist.cc + tests/memflush.cc + tests/memping.cc + tests/memrm.cc + tests/memslap.cc + tests/memstat.cc + tests/memtouch.cc + tests/namespace.h + tests/parser.cc + tests/pool.h + tests/print.h + tests/replication.h + tests/runner.h + tests/server_add.h + tests/string.h + tests/touch.h + tests/virtual_buckets.h + + util/daemon.cc + util/daemon.hpp + util/instance.cc + util/instance.hpp + util/log.hpp + util/logfile.cc + util/logfile.hpp + util/operation.cc + util/operation.hpp + util/pidfile.cc + util/pidfile.hpp + util/signal.cc + util/signal.hpp + util/string.hpp + + win32/wrappers.h + + ) +endif() diff --git a/Config.cmake b/Config.cmake new file mode 100644 index 00000000..93aead46 --- /dev/null +++ b/Config.cmake @@ -0,0 +1,10 @@ +set(LIBMEMCACHED_WITH_SASL_SUPPORT 0) + +set(HAVE_FNV64_HASH 1) +set(HAVE_MURMUR_HASH 1) +set(HAVE_HSIEH_HASH 0) + +set(HAVE_DTRACE 0) +set(HAVE_VISIBILITY 1) +set(HAVE_GCC_BUILTIN_ATOMIC 1) +set(HAVE_SHARED_ENABLED 1) diff --git a/Include.cmake b/Include.cmake new file mode 100644 index 00000000..522f61a3 --- /dev/null +++ b/Include.cmake @@ -0,0 +1,40 @@ + +include(CheckTypeSize) +include(CheckIncludeFileCXX) +include(CheckCXXSymbolExists) +include(CheckCXXCompilerFlag) + +function(safe_string STRING OUTPUT) + string(REGEX REPLACE "[^0-9a-zA-Z_]" "_" HEADER_SAFE ${STRING}) + string(TOUPPER "${HEADER_SAFE}" HEADER_DEFN) + set(${OUTPUT} ${HEADER_DEFN} PARENT_SCOPE) +endfunction(safe_string) + +function(define_cpp DEF) + safe_string(${DEF} CNST) + add_compile_definitions(HAVE_${CNST}=1) +endfunction(define_cpp) + +function(check_header HEADER_PATH) + safe_string(${HEADER_PATH} HEADER_CONST) + check_include_file_cxx(${HEADER_PATH} HAVE_${HEADER_CONST}) +endfunction(check_header) + +function(check_decl DECL HEADER) + safe_string(${DECL} DECL_CONST) + check_cxx_symbol_exists(${DECL} ${HEADER} HAVE_${DECL_CONST}) +endfunction(check_decl) + +function(check_type TYPE HEADER) + safe_string(${TYPE} TYPE_CONST) + SET(CMAKE_EXTRA_INCLUDE_FILES ${HEADER}) + check_type_size(${TYPE} ${TYPE_CONST}) + SET(CMAKE_EXTRA_INCLUDE_FILES) +endfunction(check_type) + +function(check_debug) + if(${CMAKE_BUILD_TYPE} STREQUAL Debug) + add_compile_definitions(DEBUG=1) + add_compile_options(-Wall -Wextra) + endif() +endfunction(check_debug) diff --git a/clients/CMakeLists.txt b/clients/CMakeLists.txt new file mode 100644 index 00000000..59fa4aa7 --- /dev/null +++ b/clients/CMakeLists.txt @@ -0,0 +1,30 @@ +include_directories(..) + +add_library(utilities STATIC utilities.cc) +link_libraries(utilities memcachedinternal) + +add_executable(memcapable memcapable.cc ../libmemcached/byteorder.cc) +add_executable(memcat memcat.cc) +add_executable(memcp memcp.cc) +add_executable(memdump memdump.cc) +add_executable(memerror memerror.cc) +add_executable(memexist memexist.cc) +add_executable(memflush memflush.cc) +add_executable(memparse memparse.cc) +add_executable(memping memping.cc) +add_executable(memrm memrm.cc) +add_executable(memslap memslap.cc generator.cc execute.cc) +add_executable(memstat memstat.cc) +add_executable(memtouch memtouch.cc) + +target_link_libraries(memcapable ${CMAKE_THREAD_LIBS_INIT}) +target_link_libraries(memping memcachedutil) +target_link_libraries(memslap ${CMAKE_THREAD_LIBS_INIT}) + +find_library(LIBEVENT event) + +if(LIBEVENT) + add_executable(memaslap + memaslap.c generator.cc execute.cc ms_conn.c ms_setting.c ms_sigsegv.c ms_stats.c ms_task.c ms_thread.c) + target_link_libraries(memaslap event) +endif() diff --git a/clients/ms_conn.c b/clients/ms_conn.c index 85e84739..9c4b7f53 100644 --- a/clients/ms_conn.c +++ b/clients/ms_conn.c @@ -19,7 +19,10 @@ #include #include #include -#include + +#if defined(HAVE_ARPA_INET_H) +# include +#endif #if defined(HAVE_SYS_TIME_H) # include diff --git a/libhashkit-1.0/CMakeLists.txt b/libhashkit-1.0/CMakeLists.txt new file mode 100644 index 00000000..8fa3e9a2 --- /dev/null +++ b/libhashkit-1.0/CMakeLists.txt @@ -0,0 +1,2 @@ + +configure_file(configure.h.in configure.h @ONLY) diff --git a/libhashkit/CMakeLists.txt b/libhashkit/CMakeLists.txt new file mode 100644 index 00000000..36bb15b9 --- /dev/null +++ b/libhashkit/CMakeLists.txt @@ -0,0 +1,38 @@ +if(HSIEH) + set(HSIEH_CC hsieh.cc) +else() + set(HSIEH_CC nohsieh.cc) +endif() + +set(AUTOHEADER_FILE mem_config.h) +configure_file(hashkitcon.h.in hashkitcon.h @ONLY) + +include_directories(..) + +add_library(hashkit + aes.cc + algorithm.cc + behavior.cc + crc32.cc + digest.cc + encrypt.cc + fnv_32.cc + fnv_64.cc + function.cc + has.cc + hashkit.cc + ${HSIEH_CC} + jenkins.cc + ketama.cc + md5.cc + murmur.cc + murmur3.cc + murmur3_api.cc + nohsieh.cc + one_at_a_time.cc + rijndael.cc + str_algorithm.cc + strerror.cc + string.cc + ) +target_compile_options(hashkit PRIVATE -DBUILDING_HASHKIT) diff --git a/libmemcached-1.0/CMakeLists.txt b/libmemcached-1.0/CMakeLists.txt new file mode 100644 index 00000000..8fa3e9a2 --- /dev/null +++ b/libmemcached-1.0/CMakeLists.txt @@ -0,0 +1,2 @@ + +configure_file(configure.h.in configure.h @ONLY) diff --git a/libmemcached-1.0/configure.h.in b/libmemcached-1.0/configure.h.in index 3f0465a0..70b5e1dd 100644 --- a/libmemcached-1.0/configure.h.in +++ b/libmemcached-1.0/configure.h.in @@ -41,8 +41,8 @@ extern "C" { #endif -@DEPRECATED@ -@LIBMEMCACHED_WITH_SASL_SUPPORT@ +#cmakedefine DEPRECATED +#cmakedefine LIBMEMCACHED_WITH_SASL_SUPPORT #define LIBMEMCACHED_VERSION_STRING "@LIBMEMCACHED_VERSION_STRING@" #define LIBMEMCACHED_VERSION_HEX @LIBMEMCACHED_VERSION_HEX@ diff --git a/libmemcached/CMakeLists.txt b/libmemcached/CMakeLists.txt new file mode 100644 index 00000000..a28aeb8d --- /dev/null +++ b/libmemcached/CMakeLists.txt @@ -0,0 +1,58 @@ + +add_subdirectory(csl) + +include_directories(..) + +add_library(memcached + allocators.cc + analyze.cc + array.c + auto.cc + backtrace.cc + behavior.cc + byteorder.cc + callback.cc + connect.cc + delete.cc + do.cc + dump.cc + encoding_key.cc + error.cc + exist.cc + fetch.cc + flag.cc + flush.cc + flush_buffers.cc + get.cc + hash.cc + hosts.cc + initialize_query.cc + instance.cc + io.cc + key.cc + memcached.cc + namespace.cc + options.cc + parse.cc + poll.cc + purge.cc + quit.cc + response.cc + result.cc + sasl.cc + server.cc + server_list.cc + stats.cc + storage.cc + strerror.cc + string.cc + touch.cc + udp.cc + verbosity.cc + version.cc + virtual_bucket.c + ) + +target_link_libraries(memcached csl hashkit ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS}) + +target_compile_definitions(memcached PRIVATE -DBUILDING_LIBMEMCACHED) diff --git a/libmemcached/csl/CMakeLists.txt b/libmemcached/csl/CMakeLists.txt new file mode 100644 index 00000000..0200add8 --- /dev/null +++ b/libmemcached/csl/CMakeLists.txt @@ -0,0 +1,18 @@ + +find_package(FLEX) +find_package(BISON) + +flex_target(CSL_SCANNER scanner.l ${CMAKE_SOURCE_DIR}/scanner.cc + DEFINES_FILE ${CMAKE_SOURCE_DIR}/scanner.h + ) +bison_target(CSL_PARSER parser.yy ${CMAKE_SOURCE_DIR}/parser.cc + DEFINES_FILE ${CMAKE_SOURCE_DIR}/parser.h + ) +add_flex_bison_dependency(CSL_SCANNER CSL_PARSER) + +include_directories(../..) +add_library(csl STATIC + context.cc + ${BISON_CSL_PARSER_OUTPUTS} + ${FLEX_CSL_SCANNER_OUTPUTS} + ) diff --git a/libmemcached/csl/context.cc b/libmemcached/csl/context.cc index 44fb4358..fa2500be 100644 --- a/libmemcached/csl/context.cc +++ b/libmemcached/csl/context.cc @@ -38,7 +38,7 @@ #include #include -void Context::abort(const char *error_arg, yytokentype last_token, const char *last_token_str) +void Context::abort(const char *error_arg, config_tokentype last_token, const char *last_token_str) { rc= MEMCACHED_PARSE_ERROR; (void)last_token; @@ -58,7 +58,7 @@ void Context::abort(const char *error_arg, yytokentype last_token, const char *l memcached_set_parser_error(*memc, MEMCACHED_AT, "unknown parsing error"); } -void Context::error(const char *error_arg, yytokentype last_token, const char *last_token_str) +void Context::error(const char *error_arg, config_tokentype last_token, const char *last_token_str) { rc= MEMCACHED_PARSE_ERROR; if (not error_arg) diff --git a/libmemcached/csl/context.h b/libmemcached/csl/context.h index 8517fdfd..64d1f2f3 100644 --- a/libmemcached/csl/context.h +++ b/libmemcached/csl/context.h @@ -106,8 +106,8 @@ public: return _hostname; } - void abort(const char *, yytokentype, const char *); - void error(const char *, yytokentype, const char* ); + void abort(const char *, config_tokentype, const char *); + void error(const char *, config_tokentype, const char* ); ~Context() { @@ -116,7 +116,7 @@ public: memc->state.is_parsing= false; } - yytokentype previous_token; + config_tokentype previous_token; void *scanner; const char *buf; const char *begin; diff --git a/libmemcached/csl/parser.yy b/libmemcached/csl/parser.yy index dd9c720b..dba76a53 100644 --- a/libmemcached/csl/parser.yy +++ b/libmemcached/csl/parser.yy @@ -42,17 +42,15 @@ class Context; %} -%error-verbose +%define parse.error verbose +%define api.prefix {config_} +%define api.pure %debug %defines %expect 0 -%output "libmemcached/csl/parser.cc" -%defines "libmemcached/csl/parser.h" %lex-param { yyscan_t *scanner } -%name-prefix="config_" %parse-param { class Context *context } %parse-param { yyscan_t *scanner } -%pure-parser %require "2.5" %start begin %verbose @@ -82,18 +80,18 @@ int conf_lex(YYSTYPE* lvalp, void* scanner); #define stryytname(__yytokentype) ((__yytokentype) < YYNTOKENS ) ? yytname[(__yytokentype)] : "" -#define parser_abort(__context, __error_message) do { (__context)->abort((__error_message), yytokentype(select_yychar(__context)), stryytname(YYTRANSLATE(select_yychar(__context)))); YYABORT; } while (0) +#define parser_abort(__context, __error_message) do { (__context)->abort((__error_message), config_tokentype(select_yychar(__context)), stryytname(YYTRANSLATE(select_yychar(__context)))); YYABORT; } while (0) // This is bison calling error. inline void __config_error(Context *context, yyscan_t *scanner, const char *error, int last_token, const char *last_token_str) { if (not context->end()) { - context->error(error, yytokentype(last_token), last_token_str); + context->error(error, config_tokentype(last_token), last_token_str); } else { - context->error(error, yytokentype(last_token), last_token_str); + context->error(error, config_tokentype(last_token), last_token_str); } } diff --git a/libmemcached/csl/scanner.l b/libmemcached/csl/scanner.l index bb233d6f..6db562ec 100644 --- a/libmemcached/csl/scanner.l +++ b/libmemcached/csl/scanner.l @@ -101,7 +101,6 @@ %option noinput %option nounput %option noyywrap -%option outfile="libmemcached/csl/scanner.cc" header-file="libmemcached/csl/scanner.h" %option perf-report %option prefix="config_" %option reentrant diff --git a/libmemcachedinternal/CMakeLists.txt b/libmemcachedinternal/CMakeLists.txt new file mode 100644 index 00000000..4a2fae18 --- /dev/null +++ b/libmemcachedinternal/CMakeLists.txt @@ -0,0 +1,55 @@ +include_directories(..) + +add_library(memcachedinternal + ../libmemcached/allocators.cc + ../libmemcached/analyze.cc + ../libmemcached/array.c + ../libmemcached/auto.cc + ../libmemcached/backtrace.cc + ../libmemcached/behavior.cc + ../libmemcached/byteorder.cc + ../libmemcached/callback.cc + ../libmemcached/connect.cc + ../libmemcached/delete.cc + ../libmemcached/do.cc + ../libmemcached/dump.cc + ../libmemcached/encoding_key.cc + ../libmemcached/error.cc + ../libmemcached/exist.cc + ../libmemcached/fetch.cc + ../libmemcached/flag.cc + ../libmemcached/flush.cc + ../libmemcached/flush_buffers.cc + ../libmemcached/get.cc + ../libmemcached/hash.cc + ../libmemcached/hosts.cc + ../libmemcached/initialize_query.cc + ../libmemcached/instance.cc + ../libmemcached/io.cc + ../libmemcached/key.cc + ../libmemcached/memcached.cc + ../libmemcached/namespace.cc + ../libmemcached/options.cc + ../libmemcached/parse.cc + ../libmemcached/poll.cc + ../libmemcached/purge.cc + ../libmemcached/quit.cc + ../libmemcached/response.cc + ../libmemcached/result.cc + ../libmemcached/sasl.cc + ../libmemcached/server.cc + ../libmemcached/server_list.cc + ../libmemcached/stats.cc + ../libmemcached/storage.cc + ../libmemcached/strerror.cc + ../libmemcached/string.cc + ../libmemcached/touch.cc + ../libmemcached/udp.cc + ../libmemcached/verbosity.cc + ../libmemcached/version.cc + ../libmemcached/virtual_bucket.c + ) + +target_link_libraries(memcachedinternal csl hashkit ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS}) + +target_compile_definitions(memcachedinternal PRIVATE -DBUILDING_LIBMEMCACHEDINTERNAL) diff --git a/libmemcachedutil/CMakeLists.txt b/libmemcachedutil/CMakeLists.txt new file mode 100644 index 00000000..ff17e2e0 --- /dev/null +++ b/libmemcachedutil/CMakeLists.txt @@ -0,0 +1,15 @@ + +find_package(Threads) + +add_library(memcachedutil + ../libmemcached/backtrace.cc + flush.cc + pid.cc + ping.cc + pool.cc + version.cc + ) + +target_compile_definitions(memcachedutil PRIVATE -DBUILDING_LIBMEMCACHED) + +target_link_libraries(memcachedutil memcached ${CMAKE_THREAD_LIBS_INIT})