[apr-util] Add crypto feature and don't require OpenSSL if not needed (#27644)

* [apr-util] add crypto feature

* [apr-util] Use CMake variables to control OpenSSL

* [apr-util] remove disable find package
This commit is contained in:
Victor Romero 2022-11-07 15:34:34 -08:00 committed by GitHub
parent 57ae838ee8
commit 94b63bd8f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 34 additions and 6 deletions

View File

@ -4,6 +4,12 @@ vcpkg_download_distfile(ARCHIVE
SHA512 40eff8a37c0634f7fdddd6ca5e596b38de15fd10767a34c30bbe49c632816e8f3e1e230678034f578dd5816a94f246fb5dfdf48d644829af13bf28de3225205d
)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
crypto APU_HAVE_CRYPTO
crypto CMAKE_REQUIRE_FIND_PACKAGE_OpenSSL
)
if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_extract_source_archive(
SOURCE_PATH
@ -16,6 +22,8 @@ if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${FEATURE_OPTIONS}
OPTIONS_DEBUG
-DDISABLE_INSTALL_HEADERS=ON
)
@ -54,6 +62,14 @@ else()
ARCHIVE "${ARCHIVE}"
)
if ("crypto" IN_LIST FEATURES)
set(CRYPTO_OPTIONS
"--with-crypto=yes"
"--with-openssl=${CURRENT_INSTALLED_DIR}")
else()
set(CRYPTO_OPTIONS "--with-crypto=no")
endif()
# To cross-compile you will need a triplet file that locates the tool chain and sets --host and --cache parameters of "./configure".
# The ${VCPKG_PLATFORM_TOOLSET}.cache file must have been generated on the targeted host using "./configure -C".
# For example, to target aarch64-linux-gnu, triplets/aarch64-linux-gnu.cmake should contain (beyond the standard content):
@ -71,9 +87,9 @@ else()
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
"--prefix=${CURRENT_INSTALLED_DIR}"
${CRYPTO_OPTIONS}
"--with-apr=${CURRENT_INSTALLED_DIR}/tools/apr"
"--with-openssl=${CURRENT_INSTALLED_DIR}"
"-with-expat=${CURRENT_INSTALLED_DIR}"
"--with-expat=${CURRENT_INSTALLED_DIR}"
"${CONFIGURE_PARAMETER_1}"
"${CONFIGURE_PARAMETER_2}"
"${CONFIGURE_PARAMETER_3}"

View File

@ -1,18 +1,25 @@
{
"name": "apr-util",
"version": "1.6.1",
"port-version": 9,
"port-version": 10,
"description": "Apache Portable Runtime (APR) project mission is to create and maintain software libraries that provide a predictable and consistent interface to underlying platform-specific implementation",
"homepage": "https://apr.apache.org/",
"license": "Apache-2.0",
"dependencies": [
"apr",
"expat",
"openssl",
{
"name": "vcpkg-cmake",
"host": true,
"platform": "windows"
}
]
],
"features": {
"crypto": {
"description": "Crypto support",
"dependencies": [
"openssl"
]
}
}
}

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "41451c5e1e1fa8344f6c2d1baf6c0f14b656c433",
"version": "1.6.1",
"port-version": 10
},
{
"git-tree": "b6d7bb58f16bd75a40a434742d0c0a12b89645d4",
"version": "1.6.1",

View File

@ -130,7 +130,7 @@
},
"apr-util": {
"baseline": "1.6.1",
"port-version": 9
"port-version": 10
},
"apsi": {
"baseline": "0.8.2",