Skip to content

Commit cad30e9

Browse files
authored
Fix sasl2 library detection (#1070)
1 parent e998bf5 commit cad30e9

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

build/cmake/FindSASL2.cmake

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
include (CheckSymbolExists)
2+
include (CMakePushCheckState)
23

34
message (STATUS "Searching for sasl/sasl.h")
45
find_path (
@@ -27,12 +28,16 @@ endif ()
2728
if (SASL_INCLUDE_DIRS AND SASL_LIBRARIES)
2829
set (SASL_FOUND 1)
2930

31+
cmake_push_check_state ()
32+
list (APPEND CMAKE_REQUIRED_INCLUDES ${SASL_INCLUDE_DIRS})
33+
list (APPEND CMAKE_REQUIRED_LIBRARIES ${SASL_LIBRARIES})
3034
check_symbol_exists (
3135
sasl_client_done
32-
${SASL_INCLUDE_DIRS}/sasl/sasl.h
33-
MONGOC_HAVE_SASL_CLIENT_DONE)
36+
sasl/sasl.h
37+
HAVE_SASL_CLIENT_DONE)
38+
cmake_pop_check_state()
3439

35-
if (MONGOC_HAVE_SASL_CLIENT_DONE)
40+
if (HAVE_SASL_CLIENT_DONE)
3641
set (MONGOC_HAVE_SASL_CLIENT_DONE 1)
3742
else ()
3843
set (MONGOC_HAVE_SASL_CLIENT_DONE 0)

0 commit comments

Comments
 (0)