Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions OpenSSLTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ if (MSVC)
set(OPENSSL_OS_LIBRARIES ws2_32.lib Crypt32.lib)
endif ()

set(_openssl_tests_saved_required_includes ${CMAKE_REQUIRED_INCLUDES})
set(_openssl_tests_saved_required_libraries ${CMAKE_REQUIRED_LIBRARIES})

set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES} ${CMAKE_DL_LIBS} ${OPENSSL_OS_LIBRARIES})
# Use all includes, not just OpenSSL includes to see if there are
# include files of different versions that do not match
get_directory_property(includes INCLUDE_DIRECTORIES)
set(CMAKE_REQUIRED_INCLUDES ${includes})
set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR} ${includes})

check_c_source_compiles(
"
Expand Down Expand Up @@ -83,5 +86,7 @@ if (NOT CMAKE_CROSSCOMPILING AND NOT MSVC)
endif ()
endif ()

set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_LIBRARIES)
set(CMAKE_REQUIRED_INCLUDES ${_openssl_tests_saved_required_includes})
set(CMAKE_REQUIRED_LIBRARIES ${_openssl_tests_saved_required_libraries})
unset(_openssl_tests_saved_required_includes)
unset(_openssl_tests_saved_required_libraries)
Loading