Skip to content

Commit

Permalink
[qt5-base] Add option to link to OpenSSL at compile-time
Browse files Browse the repository at this point in the history
By default Qt loads OpenSSL at runtime.

This commit adds a "QT_OPENSSL_LINK" option, which specifies "-openssl-linked". The option is enabled by default for static configurations.

From https://doc.qt.io/qt-5/ssl.html:

"By default, an SSL-enabled Qt library dynamically loads any installed OpenSSL library at run-time. However, it is possible to link against the library at compile-time by configuring Qt with the -openssl-linked option."
  • Loading branch information
davidebeatrici committed Nov 22, 2019
1 parent cccd1ed commit 9a01ec2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ports/qt5-base/CONTROL
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Source: qt5-base
Version: 5.12.5-2
Version: 5.12.5-3
Homepage: https://www.qt.io/
Description: Qt5 Application Framework Base Module. Includes Core, GUI, Widgets, Networking, SQL, Concurrent and other essential qt components.
Build-Depends: zlib, libjpeg-turbo, libpng, freetype, pcre2, harfbuzz, sqlite3, libpq, double-conversion, openssl

Feature: latest
Description: Build latest qt version (5.13.1) instead of LTS
Description: Build latest qt version (5.13.1) instead of LTS
12 changes: 11 additions & 1 deletion ports/qt5-base/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
vcpkg_buildpath_length_warning(37)

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
option(QT_OPENSSL_LINK "Link against OpenSSL at compile-time." ON)
else()
option(QT_OPENSSL_LINK "Link against OpenSSL at compile-time." OFF)
endif()

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)

Expand Down Expand Up @@ -75,6 +81,10 @@ list(APPEND CORE_OPTIONS
-system-sqlite
-system-harfbuzz)

if(QT_OPENSSL_LINK)
list(APPEND CORE_OPTIONS -openssl-linked)
endif()

find_library(ZLIB_RELEASE NAMES z zlib PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH)
find_library(ZLIB_DEBUG NAMES z zlib zd zlibd PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH)
find_library(JPEG_RELEASE NAMES jpeg jpeg-static PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH)
Expand Down Expand Up @@ -282,4 +292,4 @@ if(QT_BUILD_LATEST)
DESTINATION
${CURRENT_PACKAGES_DIR}/share/qt5
)
endif()
endif()

0 comments on commit 9a01ec2

Please sign in to comment.