Use prefixed ssl libs when "-openssl-linked" configure params is used

As long as we do a multi abi build in one go there is no easy way for us to know
where the ssl libs are located for each ABI. The easiest way is to use libs
prefixed with the ABI.

For configure set we are using "_arm64-v8a" prefix as the configure script will
always use arm64-v8a to run the tests.

Don't show the OPENSSL_LIBS example as it won't work on Android.

Here https://github.com/KDAB/android_openssl/commit/ebb0b68be4 you can find
a script which builds these libs.

Fixes: QTBUG-80862
Change-Id: I019c2a208ae48a7356b8f3933d0f4aad5ac156a3
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
bb10
BogDan Vatra 2020-01-06 16:06:35 +02:00
parent 9d7ed92f6e
commit e52239f525
2 changed files with 10 additions and 4 deletions

View File

@ -93,6 +93,10 @@
"libs": "-llibssl -llibcrypto -lUser32 -lWs2_32 -lAdvapi32 -lCrypt32",
"condition": "config.msvc"
},
{
"libs": "-lssl_arm64-v8a -lcrypto_arm64-v8a",
"condition": "config.android"
},
{
"libs": "-lssl -lcrypto",
"condition": "!config.msvc"
@ -445,7 +449,7 @@
"report": [
{
"type": "note",
"condition": "features.openssl-linked && libs.openssl.source != 0
"condition": "!config.android && features.openssl-linked && libs.openssl.source != 0
&& input.openssl.prefix == '' && input.openssl.libs == '' && input.openssl.libs.debug == ''",
"message": "When linking against OpenSSL, you can override the default
library names through OPENSSL_LIBS.

View File

@ -125,9 +125,11 @@ qtConfig(ssl) {
# - libs in <OPENSSL_DIR>\lib\VC\static
# - configure: -openssl -openssl-linked -I <OPENSSL_DIR>\include -L <OPENSSL_DIR>\lib\VC\static OPENSSL_LIBS="-lUser32 -lAdvapi32 -lGdi32" OPENSSL_LIBS_DEBUG="-lssleay32MDd -llibeay32MDd" OPENSSL_LIBS_RELEASE="-lssleay32MD -llibeay32MD"
qtConfig(openssl-linked): \
QMAKE_USE_FOR_PRIVATE += openssl
else: \
qtConfig(openssl-linked): {
android {
build_pass: LIBS_PRIVATE += -lssl_$${QT_ARCH} -lcrypto_$${QT_ARCH}
} else: QMAKE_USE_FOR_PRIVATE += openssl
} else: \
QMAKE_USE_FOR_PRIVATE += openssl/nolink
win32 {
LIBS_PRIVATE += -lcrypt32