From 440f4c2b28515d2007b81ac00b549bbf14fa9f64 Mon Sep 17 00:00:00 2001 From: Gautham B A Date: Sun, 17 Jul 2022 20:47:30 +0530 Subject: [PATCH] HDFS-16654. Link OpenSSL lib for CMake deps check (#4538) * The check_c_source_compiles fails on Windows while linking with an "unable to resolve external symbol" error. * This PR links OpenSSL lib for this check to fix this issue. --- .../hadoop-hdfs-native-client/src/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/CMakeLists.txt b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/CMakeLists.txt index 1e8a689e0c..8522fc8b92 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/CMakeLists.txt +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/CMakeLists.txt @@ -127,7 +127,8 @@ if(OPENSSL_LIBRARY AND OPENSSL_INCLUDE_DIR) include(CheckCSourceCompiles) set(OLD_CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES}) set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) - check_c_source_compiles("#include \"${OPENSSL_INCLUDE_DIR}/openssl/evp.h\"\nint main(int argc, char **argv) { return !EVP_aes_256_ctr; }" HAS_NEW_ENOUGH_OPENSSL) + set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARY}) + check_c_source_compiles("#include \nint main(int argc, char **argv) { return !EVP_aes_256_ctr; }" HAS_NEW_ENOUGH_OPENSSL) set(CMAKE_REQUIRED_INCLUDES ${OLD_CMAKE_REQUIRED_INCLUDES}) if(NOT HAS_NEW_ENOUGH_OPENSSL) message("The OpenSSL library installed at ${OPENSSL_LIBRARY} is too old. You need a version at least new enough to have EVP_aes_256_ctr.")