Skip to content

Commit bf4c46b

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
2 parents da57bd5 + 1251d47 commit bf4c46b

File tree

2 files changed

+25
-17
lines changed

2 files changed

+25
-17
lines changed

cmake/ext/mysqlnd/CMakeLists.txt

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,10 @@ add_feature_info(
3333

3434
cmake_dependent_option(
3535
EXT_MYSQLND_SSL
36-
"Explicitly enable extended SSL support in the mysqlnd extension when\
37-
building without openssl extension (EXT_OPENSSL=OFF) or when using phpize. If\
38-
the openssl extension is enabled at the configure step (EXT_OPENSSL=ON),\
39-
extended SSL is enabled implicitly regardless of this option."
36+
"Explicitly enable extended SSL support in the mysqlnd extension through a\
37+
system library OpenSSL (*nix) or Crypt32 (Windows)."
4038
OFF
41-
"EXT_MYSQLND;NOT EXT_OPENSSL"
39+
[[EXT_MYSQLND AND NOT EXT_OPENSSL AND NOT CMAKE_SYSTEM_NAME STREQUAL "Windows"]]
4240
OFF
4341
)
4442

@@ -118,20 +116,29 @@ set(MYSQLND_SSL_SUPPORTED 1 CACHE INTERNAL "Enable core mysqlnd SSL code")
118116
# A deferred configuration, so it is executed after the openssl extension to
119117
# have the EXT_OPENSSL variable available.
120118
function(php_mysqlnd_post_configuration)
121-
if(EXT_MYSQLND_SSL OR EXT_OPENSSL)
122-
find_package(OpenSSL ${PHP_OPENSSL_MIN_VERSION})
123-
set_package_properties(
124-
OpenSSL
125-
PROPERTIES
126-
TYPE REQUIRED
127-
PURPOSE "Necessary to enable SSL in the mysqlnd extension."
119+
if(
120+
(
121+
NOT CMAKE_SYSTEM_NAME STREQUAL "Windows"
122+
AND (EXT_MYSQLND_SSL OR EXT_OPENSSL)
128123
)
129-
130-
target_link_libraries(php_mysqlnd PRIVATE OpenSSL::Crypto)
124+
OR CMAKE_SYSTEM_NAME STREQUAL "Windows"
125+
)
126+
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
127+
target_link_libraries(php_mysqlnd PRIVATE crypt32)
128+
else()
129+
find_package(OpenSSL ${PHP_OPENSSL_MIN_VERSION})
130+
set_package_properties(
131+
OpenSSL
132+
PROPERTIES
133+
TYPE REQUIRED
134+
PURPOSE "Necessary to enable SSL in the mysqlnd extension."
135+
)
136+
target_link_libraries(php_mysqlnd PRIVATE OpenSSL::Crypto)
137+
endif()
131138

132139
set(
133140
MYSQLND_HAVE_SSL 1
134-
CACHE INTERNAL "Enable mysqlnd extended SSL that uses OpenSSL directly"
141+
CACHE INTERNAL "Enable mysqlnd extended SSL"
135142
)
136143

137144
add_dependencies(php_mysqlnd php_hash)
@@ -140,7 +147,7 @@ function(php_mysqlnd_post_configuration)
140147
add_feature_info(
141148
"ext/mysqlnd SSL"
142149
MYSQLND_HAVE_SSL
143-
"Extended SSL support through OpenSSL"
150+
"Extended SSL support through a system library"
144151
)
145152
endfunction()
146153

cmake/main/php_config.cmake.h.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1779,7 +1779,8 @@
17791779
/* Define to 1 if mysqlnd has compressed protocol support. */
17801780
#cmakedefine MYSQLND_COMPRESSION_ENABLED 1
17811781

1782-
/* Define to 1 if mysqlnd extended SSL is enabled through OpenSSL. */
1782+
/* Define to 1 if mysqlnd has extended SSL enabled through a system library
1783+
OpenSSL (*nix systems), or Crypt32 (Windows systems). */
17831784
#cmakedefine MYSQLND_HAVE_SSL 1
17841785

17851786
/* Define to 1 if mysqlnd core SSL is enabled. */

0 commit comments

Comments
 (0)