1add_library(memcached_logger SHARED
2            logger.h
3            logger.cc
4            spdlogger.cc
5            custom_rotating_file_sink.cc
6            custom_rotating_file_sink.h)
7
8target_link_libraries(memcached_logger cJSON platform dirutils spdlog)
9set_target_properties(memcached_logger PROPERTIES SOVERSION 1.0.0)
10generate_export_header(memcached_logger
11                       EXPORT_MACRO_NAME LOGGER_PUBLIC_API
12                       EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/include/logger/visibility.h)
13add_sanitizers(memcached_logger)
14
15install(TARGETS memcached_logger
16        RUNTIME DESTINATION bin
17        LIBRARY DESTINATION lib
18        ARCHIVE DESTINATION lib)
19
20if (COUCHBASE_KV_BUILD_UNIT_TESTS)
21    add_executable(memcached_logger_test logger_test.cc)
22    target_link_libraries(memcached_logger_test gtest gtest_main mcd_util memcached_logger dirutils)
23    target_include_directories(memcached_logger_test INTERFACE PRIVATE ${Platform_SOURCE_DIR}/external)
24    add_test(NAME memcached-spdlogger-test
25             WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
26             COMMAND memcached_logger_test)
27
28    add_executable(memcached_logger_benchmark logger_benchmark.cc)
29    target_link_libraries(memcached_logger_benchmark benchmark memcached_logger)
30endif (COUCHBASE_KV_BUILD_UNIT_TESTS)
31