Skip to content

Commit 77c224b

Browse files
committed
compat BUGFIX respect crypt.h existence
1 parent 1d07e8a commit 77c224b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

CMakeModules/UseCompat.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,11 @@ macro(USE_COMPAT)
7777
elseif(NOT APPLE)
7878
list(APPEND CMAKE_REQUIRED_LIBRARIES -lcrypt)
7979
endif()
80-
check_symbol_exists(crypt_r "crypt.h;unistd.h" HAVE_CRYPT_R)
80+
if(HAVE_CRYPT_H)
81+
check_symbol_exists(crypt_r "crypt.h" HAVE_CRYPT_R)
82+
else()
83+
check_symbol_exists(crypt_r "unistd.h" HAVE_CRYPT_R)
84+
endif()
8185

8286
test_big_endian(IS_BIG_ENDIAN)
8387

0 commit comments

Comments
 (0)