Skip to content

Commit

Permalink
CMakeLists: indent push/pop check state blocks, NFC
Browse files Browse the repository at this point in the history
For readability.

Signed-off-by: Steven Noonan <[email protected]>
  • Loading branch information
Steven Noonan committed Sep 3, 2020
1 parent 1d11919 commit 1e0a211
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ if (WIN32)
# Check whether BCrypt can be used with this SDK version
#
cmake_push_check_state()
set(CMAKE_REQUIRED_LIBRARIES bcrypt)
check_symbol_exists(BCryptEncrypt windows.h BCRYPT_AVAILABLE)
set(CMAKE_REQUIRED_LIBRARIES bcrypt)
check_symbol_exists(BCryptEncrypt windows.h BCRYPT_AVAILABLE)
cmake_pop_check_state()
if (NOT BCRYPT_AVAILABLE AND USE_CRYPTO STREQUAL "BCrypt")
message(FATAL_ERROR "You're on Windows but BCrypt seems to be unavailable, you will need OpenSSL")
Expand Down Expand Up @@ -107,24 +107,24 @@ if (USE_CRYPTO25519 STREQUAL "OpenSSL" OR USE_CRYPTO STREQUAL "OpenSSL")
# Ensure the OpenSSL version is recent enough. We need a bunch of EVP
# functionality.
cmake_push_check_state()
set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES OpenSSL::Crypto)
if(WIN32 AND OPENSSL_USE_STATIC_LIBS)
list(APPEND CMAKE_REQUIRED_LIBRARIES ws2_32 crypt32)
endif()
check_symbol_exists(EVP_MD_CTX_free openssl/evp.h OPENSSL_NEW_ENOUGH)
if (NOT OPENSSL_NEW_ENOUGH)
message(FATAL_ERROR "Cannot find EVP_MD_CTX_free in OpenSSL headers/libs for the target architecture. Check that you're using OpenSSL 1.1.0 or later.")
endif()
set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES OpenSSL::Crypto)
if(WIN32 AND OPENSSL_USE_STATIC_LIBS)
list(APPEND CMAKE_REQUIRED_LIBRARIES ws2_32 crypt32)
endif()
check_symbol_exists(EVP_MD_CTX_free openssl/evp.h OPENSSL_NEW_ENOUGH)
if (NOT OPENSSL_NEW_ENOUGH)
message(FATAL_ERROR "Cannot find EVP_MD_CTX_free in OpenSSL headers/libs for the target architecture. Check that you're using OpenSSL 1.1.0 or later.")
endif()
cmake_pop_check_state()
cmake_push_check_state()
set(CMAKE_REQUIRED_LIBRARIES OpenSSL::Crypto)
if(WIN32 AND OPENSSL_USE_STATIC_LIBS)
list(APPEND CMAKE_REQUIRED_LIBRARIES ws2_32 crypt32)
endif()
if(USE_CRYPTO25519 STREQUAL "OpenSSL")
check_symbol_exists(EVP_PKEY_get_raw_public_key openssl/evp.h OPENSSL_HAS_25519_RAW)
endif()
set(CMAKE_REQUIRED_LIBRARIES OpenSSL::Crypto)
if(WIN32 AND OPENSSL_USE_STATIC_LIBS)
list(APPEND CMAKE_REQUIRED_LIBRARIES ws2_32 crypt32)
endif()
if(USE_CRYPTO25519 STREQUAL "OpenSSL")
check_symbol_exists(EVP_PKEY_get_raw_public_key openssl/evp.h OPENSSL_HAS_25519_RAW)
endif()
cmake_pop_check_state()
endif()

Expand Down

0 comments on commit 1e0a211

Please sign in to comment.