Address review note that some variables need to be set earlier.

This commit is contained in:
A.J. Beamon 2021-02-08 10:42:07 -08:00
parent 67e783acf8
commit b70c69e099
1 changed files with 2 additions and 2 deletions

View File

@ -22,14 +22,14 @@ else()
find_package(OpenSSL) find_package(OpenSSL)
if(OPENSSL_FOUND) if(OPENSSL_FOUND)
set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
set(WITH_TLS ON)
add_compile_options(-DHAVE_OPENSSL)
check_symbol_exists("OPENSSL_INIT_NO_ATEXIT" "openssl/crypto.h" OPENSSL_HAS_NO_ATEXIT) check_symbol_exists("OPENSSL_INIT_NO_ATEXIT" "openssl/crypto.h" OPENSSL_HAS_NO_ATEXIT)
if(OPENSSL_HAS_NO_ATEXIT) if(OPENSSL_HAS_NO_ATEXIT)
add_compile_options(-DHAVE_OPENSSL_INIT_NO_AT_EXIT) add_compile_options(-DHAVE_OPENSSL_INIT_NO_AT_EXIT)
else() else()
message(STATUS "Found OpenSSL without OPENSSL_INIT_NO_ATEXIT: assuming BoringSSL") message(STATUS "Found OpenSSL without OPENSSL_INIT_NO_ATEXIT: assuming BoringSSL")
endif() endif()
set(WITH_TLS ON)
add_compile_options(-DHAVE_OPENSSL)
else() else()
message(STATUS "OpenSSL was not found - Will compile without TLS Support") message(STATUS "OpenSSL was not found - Will compile without TLS Support")
message(STATUS "You can set OPENSSL_ROOT_DIR to help cmake find it") message(STATUS "You can set OPENSSL_ROOT_DIR to help cmake find it")