Skip to content

Commit f0787e1

Browse files
committed
Merge branch 'PHP-8.4'
2 parents 20195d7 + b9f1e29 commit f0787e1

File tree

3 files changed

+51
-4
lines changed

3 files changed

+51
-4
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#[=============================================================================[
2+
# FindOpenSSL
3+
4+
This module overrides the upstream CMake `FindOpenSSL` module with few
5+
customizations:
6+
7+
* Added OpenSSL_VERSION result variable for CMake < 4.2.
8+
9+
See: https://cmake.org/cmake/help/latest/module/FindOpenSSL.html
10+
#]=============================================================================]
11+
12+
# Find package with upstream CMake find module. Absolute path prevents the
13+
# maximum nesting/recursion depth error on some systems, like macOS.
14+
include(${CMAKE_ROOT}/Modules/FindOpenSSL.cmake)
15+
16+
if(CMAKE_VERSION VERSION_LESS 4.2)
17+
set(OpenSSL_VERSION "${OPENSSL_VERSION}")
18+
endif()

cmake/ext/openssl/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,14 @@ if(TARGET OpenSSL::SSL)
179179
check_symbol_exists(RAND_egd openssl/rand.h HAVE_RAND_EGD)
180180
cmake_pop_check_state()
181181

182-
if(OPENSSL_VERSION VERSION_LESS 3 AND PHP_EXT_OPENSSL_LEGACY_PROVIDER)
182+
if(OpenSSL_VERSION VERSION_LESS 3 AND PHP_EXT_OPENSSL_LEGACY_PROVIDER)
183183
message(
184184
WARNING
185185
"PHP_EXT_OPENSSL_LEGACY_PROVIDER is not available for OpenSSL version "
186-
"${OPENSSL_VERSION} and won't be enabled."
186+
"${OpenSSL_VERSION} and won't be enabled."
187187
)
188188
elseif(
189-
OPENSSL_VERSION VERSION_GREATER_EQUAL 3
189+
OpenSSL_VERSION VERSION_GREATER_EQUAL 3
190190
AND PHP_EXT_OPENSSL_LEGACY_PROVIDER
191191
)
192192
set(LOAD_OPENSSL_LEGACY_PROVIDER TRUE)
@@ -206,7 +206,7 @@ if(TARGET OpenSSL::SSL)
206206
)
207207
cmake_pop_check_state()
208208

209-
if(OPENSSL_VERSION VERSION_LESS 3.2 OR NOT HAVE_OPENSSL_ARGON2)
209+
if(OpenSSL_VERSION VERSION_LESS 3.2 OR NOT HAVE_OPENSSL_ARGON2)
210210
message(
211211
FATAL_ERROR
212212
"The OpenSSL Argon2 password hashing requires OpenSSL 3.2 or newer."

docs/cmake/modules/FindOpenSSL.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!-- This is auto-generated file. -->
2+
* Source code: [cmake/modules/FindOpenSSL.cmake](https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/FindOpenSSL.cmake)
3+
4+
# FindOpenSSL
5+
6+
This module overrides the upstream CMake `FindOpenSSL` module with few
7+
customizations:
8+
9+
* Added OpenSSL_VERSION result variable for CMake < 4.2.
10+
11+
See: https://cmake.org/cmake/help/latest/module/FindOpenSSL.html
12+
13+
## Customizing search locations
14+
15+
To customize where to look for the OpenSSL package base
16+
installation directory, a common `CMAKE_PREFIX_PATH` or
17+
package-specific `OPENSSL_ROOT` variable can be set at
18+
the configuration phase. For example:
19+
20+
```sh
21+
cmake -S <source-dir> \
22+
-B <build-dir> \
23+
-DCMAKE_PREFIX_PATH="/opt/OpenSSL;/opt/some-other-package"
24+
# or
25+
cmake -S <source-dir> \
26+
-B <build-dir> \
27+
-DOPENSSL_ROOT=/opt/OpenSSL \
28+
-DSOMEOTHERPACKAGE_ROOT=/opt/some-other-package
29+
```

0 commit comments

Comments
 (0)