@@ -120,66 +120,51 @@ target_link_libraries(
120120 $<$<PLATFORM_ID:Windows>:ws2_32>
121121)
122122
123- # A deferred configuration, so it is executed after the openssl extension to
124- # have the EXT_OPENSSL variable available.
125- function (php_mysqlnd_post_configuration)
126- if (EXT_MYSQLND_COMPRESSION)
127- find_package (ZLIB ${PHP_ZLIB_MIN_VERSION} )
128- set_package_properties(
129- ZLIB
130- PROPERTIES
131- TYPE REQUIRED
132- PURPOSE "Necessary to enable compression in the mysqlnd extension."
133- )
123+ if (EXT_MYSQLND_COMPRESSION)
124+ find_package (ZLIB ${PHP_ZLIB_MIN_VERSION} )
125+ set_package_properties(
126+ ZLIB
127+ PROPERTIES
128+ TYPE REQUIRED
129+ PURPOSE "Necessary to enable compression in the mysqlnd extension."
130+ )
134131
135- target_link_libraries (php_mysqlnd PRIVATE ZLIB::ZLIB)
132+ target_link_libraries (php_mysqlnd PRIVATE ZLIB::ZLIB)
136133
137- set (MYSQLND_COMPRESSION_ENABLED 1)
138- endif ()
134+ set (MYSQLND_COMPRESSION_ENABLED 1)
135+ endif ()
139136
140- set (MYSQLND_SSL_SUPPORTED 1)
137+ set (MYSQLND_SSL_SUPPORTED 1)
141138
142- if (
143- (
144- NOT CMAKE_SYSTEM_NAME STREQUAL "Windows"
145- AND (EXT_MYSQLND_SSL OR EXT_OPENSSL)
146- )
147- OR CMAKE_SYSTEM_NAME STREQUAL "Windows"
139+ if (
140+ (
141+ NOT CMAKE_SYSTEM_NAME STREQUAL "Windows"
142+ AND (EXT_MYSQLND_SSL OR EXT_OPENSSL)
148143 )
149- if (CMAKE_SYSTEM_NAME STREQUAL "Windows" )
150- target_link_libraries (php_mysqlnd PRIVATE crypt32)
151- else ()
152- find_package (OpenSSL ${PHP_OPENSSL_MIN_VERSION} )
153- set_package_properties(
154- OpenSSL
155- PROPERTIES
156- TYPE REQUIRED
157- PURPOSE "Necessary to enable SSL in the mysqlnd extension."
158- )
159- target_link_libraries (php_mysqlnd PRIVATE OpenSSL::Crypto)
160- endif ()
161-
162- set (MYSQLND_HAVE_SSL 1)
163-
164- add_dependencies (php_mysqlnd php_hash)
144+ OR CMAKE_SYSTEM_NAME STREQUAL "Windows"
145+ )
146+ if (CMAKE_SYSTEM_NAME STREQUAL "Windows" )
147+ target_link_libraries (php_mysqlnd PRIVATE crypt32)
148+ else ()
149+ find_package (OpenSSL ${PHP_OPENSSL_MIN_VERSION} )
150+ set_package_properties(
151+ OpenSSL
152+ PROPERTIES
153+ TYPE REQUIRED
154+ PURPOSE "Necessary to enable SSL in the mysqlnd extension."
155+ )
156+ target_link_libraries (php_mysqlnd PRIVATE OpenSSL::Crypto)
165157 endif ()
166158
167- add_feature_info(
168- "ext/mysqlnd SSL"
169- MYSQLND_HAVE_SSL
170- "Extended SSL support through a system library"
171- )
159+ set (MYSQLND_HAVE_SSL 1)
172160
173- configure_file (
174- ${PhpExtensionMysqlnd_SOURCE_DIR} /config.cmake.h.in
175- ${PhpExtensionMysqlnd_BINARY_DIR} /config.h
176- @ONLY
177- )
178- endfunction ()
161+ add_dependencies (php_mysqlnd php_hash)
162+ endif ()
179163
180- # Run at the end of the configuration.
181- cmake_language(
182- DEFER
183- DIRECTORY ${PHP_SOURCE_DIR}
184- CALL php_mysqlnd_post_configuration
164+ add_feature_info(
165+ "ext/mysqlnd SSL"
166+ MYSQLND_HAVE_SSL
167+ "Extended SSL support through a system library"
185168)
169+
170+ configure_file (config.cmake.h.in config.h @ONLY)
0 commit comments