From: Michael Wallner Date: Thu, 23 Jan 2020 12:15:32 +0000 (+0100) Subject: cmake: build success X-Git-Tag: post_cmake~29 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=4c0ac29dbad968b0a09fe4dc85c555627d3ac35a;p=awesomized%2Flibmemcached cmake: build success --- diff --git a/CMakeLists.txt b/CMakeLists.txt index d35aabd3..e0de2a01 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,8 +61,6 @@ 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) @@ -70,298 +68,7 @@ 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() +# keep last +configure_file(mem_config.h.in ${CMAKE_BINARY_DIR}/mem_config.h @ONLY) diff --git a/Include.cmake b/Include.cmake index 522f61a3..399717e3 100644 --- a/Include.cmake +++ b/Include.cmake @@ -1,8 +1,10 @@ include(CheckTypeSize) +include(CheckCSourceRuns) include(CheckIncludeFileCXX) include(CheckCXXSymbolExists) include(CheckCXXCompilerFlag) +include(CheckCXXSourceRuns) function(safe_string STRING OUTPUT) string(REGEX REPLACE "[^0-9a-zA-Z_]" "_" HEADER_SAFE ${STRING}) @@ -28,7 +30,7 @@ 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}) + check_type_size(${TYPE} ${TYPE_CONST} LANGUAGE CXX) SET(CMAKE_EXTRA_INCLUDE_FILES) endfunction(check_type) @@ -38,3 +40,21 @@ function(check_debug) add_compile_options(-Wall -Wextra) endif() endfunction(check_debug) + +function(check_stdatomic) + check_cxx_source_runs( + "#include + int main() { + std::atomic i(0); + return atomic_fetch_add(&i,1); + }" + HAVE_CXX_STDATOMIC) + check_c_source_runs( + "#include + int main() { + atomic_int i; + atomic_init(&i, 0); + return atomic_fetch_add(&i,1); + }" + HAVE_C_STDATOMIC) +endfunction(check_atomic_builtins) diff --git a/clients/CMakeLists.txt b/clients/CMakeLists.txt index 59fa4aa7..2c8dcac4 100644 --- a/clients/CMakeLists.txt +++ b/clients/CMakeLists.txt @@ -1,30 +1,54 @@ -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) + +set(CLIENTS + memcapable + memcat + memcp + memdump + memerror + memexist + memflush + memparse + memping + memrm + memslap + memstat + memtouch) + +add_library(libclient_utilities STATIC utilities.cc) +add_library(client_utilities ALIAS libclient_utilities) +target_include_directories(libclient_utilities PRIVATE ..) +target_link_libraries(libclient_utilities libmemcachedinternal) + +add_library(libclient_slap STATIC generator.cc execute.cc) +add_library(client_slap ALIAS libclient_slap) +target_include_directories(libclient_slap PRIVATE ..) +target_link_libraries(libclient_slap libmemcachedinternal) + +foreach(CLIENT IN LISTS CLIENTS) + add_executable(${CLIENT} ${CLIENT}.cc) + target_include_directories(${CLIENT} PRIVATE ..) + target_link_libraries(${CLIENT} libclient_utilities) +endforeach() + +# extra sources + +target_sources(memcapable PRIVATE ../libmemcached/byteorder.cc) + +# extra libs target_link_libraries(memcapable ${CMAKE_THREAD_LIBS_INIT}) -target_link_libraries(memping memcachedutil) -target_link_libraries(memslap ${CMAKE_THREAD_LIBS_INIT}) +target_link_libraries(memping libmemcachedutil) +target_link_libraries(memslap libclient_slap ${CMAKE_THREAD_LIBS_INIT}) + +# memaslap is special find_library(LIBEVENT event) +check_stdatomic() -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) +if(LIBEVENT AND HAVE_C_STDATOMIC) + check_decl(getline stdio.h) + add_executable(memaslap memaslap.c + ms_conn.c ms_setting.c ms_sigsegv.c ms_stats.c ms_task.c ms_thread.c) + target_include_directories(memaslap PRIVATE ..) + target_link_libraries(memaslap libclient_slap libclient_utilities ${LIBEVENT} ${CMAKE_THREAD_LIBS_INIT}) endif() diff --git a/clients/ms_atomic.h b/clients/ms_atomic.h index 7559044a..045f0a61 100644 --- a/clients/ms_atomic.h +++ b/clients/ms_atomic.h @@ -45,6 +45,45 @@ # define atomic_dec_16_nv(X) __sync_fetch_and_sub((X), 1) # define atomic_dec_32_nv(X) __sync_fetch_and_sub((X), 1) # define atomic_dec_size_nv(X) __sync_fetch_and_sub((X), 1) +#elif HAVE_C_STDATOMIC +# include +# define atomic_add_8(X, Y) atomic_fetch_add(X, Y) +# define atomic_add_16(X, Y) atomic_fetch_add(X, Y) +# define atomic_add_32(X, Y) atomic_fetch_add(X, Y) +# define atomic_add_size(X, Y) atomic_fetch_add(X, Y) +# define atomic_dec_8(X) atomic_fetch_sub(X, 1) +# define atomic_dec_16(X) atomic_fetch_sub(X, 1) +# define atomic_dec_32(X) atomic_fetch_sub(X, 1) +# define atomic_dec_size(X) atomic_fetch_sub(X, 1) +/* The same as above, but these return the new value instead of void */ +# define ATOMIC_ADD_FETCH_DECL(T) \ +static inline T atomic_add_fetch_##T(volatile T *ptr, T add) { \ + T des, cur = atomic_load(ptr); \ + do { \ + des = cur + add; \ + } while(!atomic_compare_exchange_weak(ptr, &cur, des)); \ + return des; \ +} +# define ATOMIC_SUB_FETCH_DECL(T) \ +T atomic_sub_fetch_##T(volatile T *ptr) { \ + T des, cur = atomic_load(ptr); \ + do { \ + des = cur - 1; \ + } while(!atomic_compare_exchange_weak(ptr, &cur, des)); \ + return des; \ +} +ATOMIC_ADD_FETCH_DECL(uint8_t) +# define atomic_add_8_nv(X, Y) atomic_add_fetch_uint8_t(X, Y) +ATOMIC_ADD_FETCH_DECL(uint16_t) +# define atomic_add_16_nv(X, Y) atomic_add_fetch_uint16_t(X, Y) +ATOMIC_ADD_FETCH_DECL(uint32_t) +# define atomic_add_32_nv(X, Y) atomic_add_fetch_uint32_t(X, Y) +ATOMIC_ADD_FETCH_DECL(size_t) +# define atomic_add_size_nv(X, Y) atomic_add_fetch_size_t(X, Y) +# define atomic_dec_8_nv(X) atomic_sub_fetch(X, Y) +# define atomic_dec_16_nv(X) atomic_sub_fetch(X, Y) +# define atomic_dec_32_nv(X) atomic_sub_fetch(X, Y) +# define atomic_dec_size_nv(X) atomic_sub_fetch(X, Y) #else #warning "Atomic operators not found so memslap will not work correctly" # define atomic_add_8(X, Y) 0 diff --git a/libhashkit/CMakeLists.txt b/libhashkit/CMakeLists.txt index 36bb15b9..dbb76dcf 100644 --- a/libhashkit/CMakeLists.txt +++ b/libhashkit/CMakeLists.txt @@ -1,15 +1,10 @@ -if(HSIEH) +if(HAVE_HSIEH_HASH) 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 +add_library(libhashkit SHARED aes.cc algorithm.cc behavior.cc @@ -35,4 +30,10 @@ add_library(hashkit strerror.cc string.cc ) -target_compile_options(hashkit PRIVATE -DBUILDING_HASHKIT) +add_library(hashkit ALIAS libhashkit) +set_target_properties(libhashkit PROPERTIES LIBRARY_OUTPUT_NAME hashkit) +target_include_directories(libhashkit PRIVATE ..) +target_compile_options(libhashkit PRIVATE -DBUILDING_HASHKIT) + +set(AUTOHEADER_FILE mem_config.h) +configure_file(hashkitcon.h.in hashkitcon.h @ONLY) diff --git a/libmemcached/CMakeLists.txt b/libmemcached/CMakeLists.txt index a28aeb8d..04b45cf5 100644 --- a/libmemcached/CMakeLists.txt +++ b/libmemcached/CMakeLists.txt @@ -1,9 +1,8 @@ add_subdirectory(csl) -include_directories(..) - -add_library(memcached +set(LIBMEMCACHED_SOURCES + ${CSL_SOURCES} allocators.cc analyze.cc array.c @@ -50,9 +49,20 @@ add_library(memcached udp.cc verbosity.cc version.cc - virtual_bucket.c - ) + virtual_bucket.c) -target_link_libraries(memcached csl hashkit ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS}) +add_library(libmemcached SHARED + ${LIBMEMCACHED_SOURCES}) +add_library(memcached ALIAS libmemcached) +set_target_properties(libmemcached PROPERTIES LIBRARY_OUTPUT_NAME memcached) +target_link_libraries(libmemcached libhashkit ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS}) +target_include_directories(libmemcached PRIVATE ..) +target_compile_definitions(libmemcached PRIVATE -DBUILDING_LIBMEMCACHED) -target_compile_definitions(memcached PRIVATE -DBUILDING_LIBMEMCACHED) +add_library(libmemcachedinternal STATIC + ${LIBMEMCACHED_SOURCES}) +add_library(memcachedinternal ALIAS libmemcachedinternal) +set_target_properties(libmemcachedinternal PROPERTIES LIBRARY_OUTPUT_NAME memcachedinternal) +target_link_libraries(libmemcachedinternal libhashkit ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS}) +target_include_directories(libmemcachedinternal PRIVATE ..) +target_compile_definitions(libmemcachedinternal PRIVATE -DBUILDING_LIBMEMCACHEDINTERNAL) diff --git a/libmemcached/csl/CMakeLists.txt b/libmemcached/csl/CMakeLists.txt index 0200add8..7b337edb 100644 --- a/libmemcached/csl/CMakeLists.txt +++ b/libmemcached/csl/CMakeLists.txt @@ -2,17 +2,16 @@ find_package(FLEX) find_package(BISON) -flex_target(CSL_SCANNER scanner.l ${CMAKE_SOURCE_DIR}/scanner.cc - DEFINES_FILE ${CMAKE_SOURCE_DIR}/scanner.h +flex_target(CSL_SCANNER scanner.l ${CMAKE_CURRENT_SOURCE_DIR}/scanner.cc + DEFINES_FILE ${CMAKE_CURRENT_SOURCE_DIR}/scanner.h ) -bison_target(CSL_PARSER parser.yy ${CMAKE_SOURCE_DIR}/parser.cc - DEFINES_FILE ${CMAKE_SOURCE_DIR}/parser.h +bison_target(CSL_PARSER parser.yy ${CMAKE_CURRENT_SOURCE_DIR}/parser.cc + DEFINES_FILE ${CMAKE_CURRENT_SOURCE_DIR}/parser.h ) add_flex_bison_dependency(CSL_SCANNER CSL_PARSER) -include_directories(../..) -add_library(csl STATIC - context.cc +set(CSL_SOURCES + csl/context.cc ${BISON_CSL_PARSER_OUTPUTS} ${FLEX_CSL_SCANNER_OUTPUTS} - ) + PARENT_SCOPE) diff --git a/libmemcached/csl/parser.yy b/libmemcached/csl/parser.yy index dba76a53..87fe4f3b 100644 --- a/libmemcached/csl/parser.yy +++ b/libmemcached/csl/parser.yy @@ -43,8 +43,9 @@ class Context; %} %define parse.error verbose -%define api.prefix {config_} %define api.pure +%define api.prefix {config_} +%define api.value.type {union CONFIG_STYPE} %debug %defines %expect 0 @@ -74,7 +75,7 @@ class Context; # endif #endif -int conf_lex(YYSTYPE* lvalp, void* scanner); +int config_lex(YYSTYPE* lvalp, void* scanner); #define select_yychar(__context) yychar == UNKNOWN ? ( (__context)->previous_token == END ? UNKNOWN : (__context)->previous_token ) : yychar diff --git a/libmemcached/csl/scanner.l b/libmemcached/csl/scanner.l index 6db562ec..d82af27c 100644 --- a/libmemcached/csl/scanner.l +++ b/libmemcached/csl/scanner.l @@ -86,6 +86,7 @@ { \ } +#define YYSTYPE CONFIG_STYPE #define YY_INPUT(buffer, result, max_size) get_lex_chars(buffer, result, max_size, PARAM) diff --git a/libmemcached/csl/symbol.h b/libmemcached/csl/symbol.h index 423d93f3..10ff603a 100644 --- a/libmemcached/csl/symbol.h +++ b/libmemcached/csl/symbol.h @@ -39,7 +39,7 @@ #include -union YYSTYPE +union CONFIG_STYPE { long long number; memcached_string_t string; @@ -52,4 +52,4 @@ union YYSTYPE server_t server; }; -typedef union YYSTYPE YYSTYPE; +typedef union CONFIG_STYPE CONFIG_STYPE; diff --git a/libmemcachedinternal/CMakeLists.txt b/libmemcachedinternal/CMakeLists.txt deleted file mode 100644 index 4a2fae18..00000000 --- a/libmemcachedinternal/CMakeLists.txt +++ /dev/null @@ -1,55 +0,0 @@ -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 index ff17e2e0..2bf1aa98 100644 --- a/libmemcachedutil/CMakeLists.txt +++ b/libmemcachedutil/CMakeLists.txt @@ -1,7 +1,7 @@ find_package(Threads) -add_library(memcachedutil +add_library(libmemcachedutil SHARED ../libmemcached/backtrace.cc flush.cc pid.cc @@ -9,7 +9,8 @@ add_library(memcachedutil pool.cc version.cc ) - -target_compile_definitions(memcachedutil PRIVATE -DBUILDING_LIBMEMCACHED) - -target_link_libraries(memcachedutil memcached ${CMAKE_THREAD_LIBS_INIT}) +add_library(memcachedutil ALIAS libmemcachedutil) +set_target_properties(libmemcachedutil PROPERTIES LIBRARY_OUTPUT_NAME memcachedutil) +target_include_directories(libmemcachedutil PRIVATE ..) +target_compile_definitions(libmemcachedutil PRIVATE -DBUILDING_LIBMEMCACHED) +target_link_libraries(libmemcachedutil libmemcached ${CMAKE_THREAD_LIBS_INIT})