From: Michael Wallner Date: Tue, 21 Feb 2023 10:33:46 +0000 (+0100) Subject: fix #107 X-Git-Tag: 1.1.4~15^2 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=07ff2f61dd38af577941ca2af8b2224f2cfbe6c2;p=awesomized%2Flibmemcached fix #107 use PKG_CONFIG_PATH="/opt/homebrew/opt/cyrus-sasl/lib/pkgconfig" on macOS to avoid the system's sasl2 lib in favor of the official one --- diff --git a/CMake/_Include.cmake b/CMake/_Include.cmake index 901375d7..7466b4ca 100644 --- a/CMake/_Include.cmake +++ b/CMake/_Include.cmake @@ -131,6 +131,11 @@ if(ENABLE_SASL) if(HAVE_LIBSASL) set(LIBMEMCACHED_WITH_SASL_SUPPORT 1) pkgconfig_export(REQUIRES libsasl2) + cmake_push_check_state() + set(CMAKE_REQUIRED_INCLUDES "${LIBSASL_INCLUDEDIR}") + set(CMAKE_REQUIRED_LIBRARIES "${LIBSASL_LIBRARIES}") + check_symbol(sasl_client_done sasl/sasl.h) + cmake_pop_check_state() endif() endif() diff --git a/src/libmemcached/sasl.cc b/src/libmemcached/sasl.cc index 21a53de4..90f663a1 100644 --- a/src/libmemcached/sasl.cc +++ b/src/libmemcached/sasl.cc @@ -92,7 +92,11 @@ static memcached_return_t resolve_names(memcached_instance_st &server, char *lad extern "C" { static void sasl_shutdown_function() { +#if HAVE_SASL_CLIENT_DONE + (void) sasl_client_done(); +#else sasl_done(); +#endif } static std::atomic sasl_startup_state(SASL_OK);