Skip to content
This repository has been archived by the owner on Apr 15, 2020. It is now read-only.

Commit

Permalink
Workaround for three known issues in OpenSSL for Android.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sacha Refshauge committed Jun 5, 2017
1 parent 5a6d6b2 commit 2c7d6c8
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
3 changes: 1 addition & 2 deletions cmake/configs/default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ hunter_config(OpenCL-cpp VERSION 2.0.10-p0)
hunter_config(OpenCV VERSION 3.2.0-p1)
hunter_config(OpenCV-Extra VERSION 3.0.0)
hunter_config(OpenNMTTokenizer VERSION 0.2.0-p1)
if(MSVC OR ANDROID)
# FIXME: https://travis-ci.org/ingenue/hunter/jobs/215460184
if(MSVC)
# FIXME: https://ci.appveyor.com/project/ingenue/hunter/build/1.0.1470
hunter_config(OpenSSL VERSION 1.0.2l)
else()
Expand Down
30 changes: 24 additions & 6 deletions cmake/projects/OpenSSL/schemes/url_sha1_openssl.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ hunter_test_string_not_empty("@HUNTER_GLOBAL_SCRIPT_DIR@")
if(APPLE)
set(configure_command "./Configure")
set(configure_opts "darwin64-x86_64-cc")
elseif(ANDROID)
# Using the ./config script is currently broken with -no* CFLAGS on ALL versions
# * https://github.com/openssl/openssl/issues/3493
# * https://github.com/openssl/openssl/blob/OpenSSL_1_1_0-stable/Configure#L560
# * https://wiki.openssl.org/index.php/Compilation_and_Installation#Configure_.26_Config
set(configure_command "./Configure")
else()
set(configure_command "./config")
endif()
Expand All @@ -54,12 +60,24 @@ if(ANDROID)
# * https://wiki.openssl.org/index.php/Android#Build_the_OpenSSL_Library
# Set environment variables similar to 'setenv-android.sh' script:
# * https://wiki.openssl.org/index.php/Android#Adjust_the_Cross-Compile_Script
set(configure_command
# Ignored. Prevents script from checking host uname
RELEASE=2.6.37
SYSTEM=android
ARCH=${ANDROID_SSL_ARCH}
${configure_command})

# Using documented method (./config script):
#set(configure_command
# Ignored. Prevents ./config from checking host uname
# RELEASE=2.6.37
# SYSTEM=android
# ARCH=${CMAKE_ANDROID_ARCH}
# ${configure_command})

# Using android-* targets is currently broken for Clang on ALL versions
# * https://github.com/openssl/openssl/pull/2229
# The ./config script only detects Android x86 and armv7 targets anyway.
# * https://github.com/openssl/openssl/issues/2490
if (CMAKE_ANDROID_ARCH MATCHES "mips64|arm64|x86_64")
set(configure_opts "linux-generic64")
else()
set(configure_opts "linux-generic32")
endif()
endif()

# Pass C compiler through
Expand Down

0 comments on commit 2c7d6c8

Please sign in to comment.