Use check_symbol_exists

This commit is contained in:
Andrew Noyes 2020-04-29 15:11:35 -07:00
parent c62a4aef97
commit 7659b1bff6
1 changed files with 1 additions and 3 deletions

View File

@ -20,9 +20,7 @@ else()
find_package(OpenSSL)
if(OPENSSL_FOUND)
set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
CHECK_CXX_SOURCE_COMPILES(
"#include <openssl/crypto.h>
int main() { (void) OPENSSL_INIT_NO_ATEXIT; }" OPENSSL_HAS_NO_ATEXIT)
check_symbol_exists("OPENSSL_INIT_NO_ATEXIT" "openssl/crypto.h" OPENSSL_HAS_NO_ATEXIT)
if(OPENSSL_HAS_NO_ATEXIT)
set(WITH_TLS ON)
add_compile_options(-DHAVE_OPENSSL)