Unverified Commit 882ba63d authored by Dominik Charousset's avatar Dominik Charousset Committed by GitHub

Merge pull request #687

Improve cross compilation support
parents 6a846488 7f11b878
...@@ -183,7 +183,7 @@ endif() ...@@ -183,7 +183,7 @@ endif()
################################################################################ ################################################################################
# check for g++ >= 4.8 or clang++ > = 3.2 # check for g++ >= 4.8 or clang++ > = 3.2
if(NOT WIN32 AND NOT CAF_NO_COMPILER_CHECK) if(NOT WIN32 AND NOT CAF_NO_COMPILER_CHECK AND NOT CMAKE_CROSSCOMPILING)
try_run(ProgramResult try_run(ProgramResult
CompilationSucceeded CompilationSucceeded
"${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}"
...@@ -547,6 +547,7 @@ if(NOT CAF_NO_OPENSSL) ...@@ -547,6 +547,7 @@ if(NOT CAF_NO_OPENSSL)
"Disable OpenSSL. Required >= 1.0.1 due to TLSv1.2 support.") "Disable OpenSSL. Required >= 1.0.1 due to TLSv1.2 support.")
set(CAF_NO_OPENSSL yes) set(CAF_NO_OPENSSL yes)
else() else()
if(NOT CMAKE_CROSSCOMPILING)
# Check if openssl headers and library versions match # Check if openssl headers and library versions match
set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES}) set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES})
set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
...@@ -564,6 +565,7 @@ if(NOT CAF_NO_OPENSSL) ...@@ -564,6 +565,7 @@ if(NOT CAF_NO_OPENSSL)
message(FATAL_ERROR message(FATAL_ERROR
"OpenSSL library version does not match headers") "OpenSSL library version does not match headers")
endif() endif()
endif()
include_directories(BEFORE ${OPENSSL_INCLUDE_DIR}) include_directories(BEFORE ${OPENSSL_INCLUDE_DIR})
add_optional_caf_lib(openssl) add_optional_caf_lib(openssl)
endif() endif()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment