Skip to content

Commit f3dab03

Browse files
committed
Merge branch 'PHP-8.4'
2 parents 36d32ce + 2d85a5f commit f3dab03

File tree

11 files changed

+89
-109
lines changed

11 files changed

+89
-109
lines changed

cmake/cmake/modules/PHP/CheckClockGettime.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ php_search_libraries(
2929
LIBRARY_VARIABLE libraryForClockGettime
3030
)
3131
if(libraryForClockGettime)
32-
add_library(PHP::CheckClockGettimeLibrary INTERFACE IMPORTED)
32+
add_library(PHP::CheckClockGettimeLibrary INTERFACE IMPORTED GLOBAL)
3333
target_link_libraries(
3434
PHP::CheckClockGettimeLibrary
3535
INTERFACE

cmake/cmake/modules/PHP/CheckGetaddrinfo.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ php_search_libraries(
3535
LIBRARY_VARIABLE libraryForGetaddrinfo
3636
)
3737
if(libraryForGetaddrinfo)
38-
add_library(PHP::CheckGetaddrinfoLibrary INTERFACE IMPORTED)
38+
add_library(PHP::CheckGetaddrinfoLibrary INTERFACE IMPORTED GLOBAL)
3939

4040
target_link_libraries(
4141
PHP::CheckGetaddrinfoLibrary

cmake/cmake/modules/PHP/CheckSHM.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ endif()
281281

282282
if(HAVE_SHM_MMAP_POSIX)
283283
if(libraryForShmOpen)
284-
add_library(PHP::CheckSHMLibrary INTERFACE IMPORTED)
284+
add_library(PHP::CheckSHMLibrary INTERFACE IMPORTED GLOBAL)
285285
target_link_libraries(PHP::CheckSHMLibrary INTERFACE ${libraryForShmOpen})
286286
endif()
287287
message(CHECK_PASS "yes")

cmake/cmake/modules/PHP/SystemExtensions.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ include(CMakePushCheckState)
7575

7676
message(CHECK_START "Enabling C and POSIX extensions")
7777

78-
add_library(PHP::SystemExtensions INTERFACE IMPORTED)
78+
add_library(PHP::SystemExtensions INTERFACE IMPORTED GLOBAL)
7979

8080
################################################################################
8181
# The following extensions are always enabled unconditionally.

cmake/cmake/modules/Zend/MaxExecutionTimers.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ if(NOT PROJECT_IS_TOP_LEVEL)
9191
set(ZEND_MAX_EXECUTION_TIMERS ${ZEND_MAX_EXECUTION_TIMERS} PARENT_SCOPE)
9292
endif()
9393

94-
add_library(Zend::MaxExecutionTimers INTERFACE IMPORTED)
94+
add_library(Zend::MaxExecutionTimers INTERFACE IMPORTED GLOBAL)
9595
if(libraryForTimerCreate)
9696
target_link_libraries(
9797
Zend::MaxExecutionTimers

cmake/cmake/presets/all-disabled.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"binaryDir": "${sourceDir}/php-build/all-disabled",
99
"installDir": "/tmp",
1010
"cacheVariables": {
11+
"EXT_COM_DOTNET": false,
1112
"EXT_CTYPE": false,
1213
"EXT_DOM": false,
1314
"EXT_FILEINFO": false,

cmake/ext/ftp/CMakeLists.txt

Lines changed: 18 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -51,41 +51,26 @@ target_sources(
5151
php_ftp.c
5252
)
5353

54-
# A deferred configuration, so it is executed after the openssl extension to
55-
# have the EXT_OPENSSL variable available.
56-
function(php_ftp_post_configuration)
57-
if(EXT_FTP_SSL OR EXT_OPENSSL)
58-
find_package(OpenSSL ${PHP_OPENSSL_MIN_VERSION})
59-
set_package_properties(
60-
OpenSSL
61-
PROPERTIES
62-
TYPE REQUIRED
63-
PURPOSE "Necessary to enable the ftp extension."
64-
)
65-
66-
target_link_libraries(php_ftp PRIVATE OpenSSL::SSL)
67-
68-
set(HAVE_FTP_SSL 1)
69-
endif()
70-
71-
add_feature_info(
72-
"ext/ftp SSL"
73-
HAVE_FTP_SSL
74-
"FTP over SSL support"
54+
if(EXT_FTP_SSL OR EXT_OPENSSL)
55+
find_package(OpenSSL ${PHP_OPENSSL_MIN_VERSION})
56+
set_package_properties(
57+
OpenSSL
58+
PROPERTIES
59+
TYPE REQUIRED
60+
PURPOSE "Necessary to enable the ftp extension."
7561
)
7662

77-
set(HAVE_FTP 1)
63+
target_link_libraries(php_ftp PRIVATE OpenSSL::SSL)
7864

79-
configure_file(
80-
${PhpExtensionFtp_SOURCE_DIR}/config.cmake.h.in
81-
${PhpExtensionFtp_BINARY_DIR}/config.h
82-
@ONLY
83-
)
84-
endfunction()
65+
set(HAVE_FTP_SSL 1)
66+
endif()
8567

86-
# Run at the end of the configuration.
87-
cmake_language(
88-
DEFER
89-
DIRECTORY ${PHP_SOURCE_DIR}
90-
CALL php_ftp_post_configuration
68+
add_feature_info(
69+
"ext/ftp SSL"
70+
HAVE_FTP_SSL
71+
"FTP over SSL support"
9172
)
73+
74+
set(HAVE_FTP 1)
75+
76+
configure_file(config.cmake.h.in config.h @ONLY)

cmake/ext/mysqlnd/CMakeLists.txt

Lines changed: 38 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -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)

cmake/sapi/CMakeLists.txt

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,29 @@ message(
1919
----------------------------"
2020
)
2121

22+
define_property(
23+
GLOBAL
24+
PROPERTY PHP_ALL_SAPIS
25+
BRIEF_DOCS "A list of all PHP SAPIs in the sapi directory"
26+
)
27+
28+
define_property(
29+
GLOBAL
30+
PROPERTY PHP_SAPIS
31+
BRIEF_DOCS "A list of all enabled PHP SAPIs"
32+
)
33+
2234
list(APPEND CMAKE_MESSAGE_CONTEXT "sapi")
2335

2436
# Traverse CMakeLists.txt files of PHP SAPIs.
2537
file(GLOB sapis ${CMAKE_CURRENT_SOURCE_DIR}/*/CMakeLists.txt)
2638
list(TRANSFORM sapis REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/|/CMakeLists.txt" "")
2739
set_property(GLOBAL PROPERTY PHP_ALL_SAPIS ${sapis})
2840

29-
get_directory_property(processed SUBDIRECTORIES)
30-
list(TRANSFORM processed REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "")
31-
3241
foreach(sapi IN LISTS sapis)
33-
if(NOT sapi IN_LIST processed)
34-
list(APPEND CMAKE_MESSAGE_CONTEXT "${sapi}")
35-
add_subdirectory("${sapi}")
36-
list(POP_BACK CMAKE_MESSAGE_CONTEXT)
37-
endif()
42+
list(APPEND CMAKE_MESSAGE_CONTEXT "${sapi}")
43+
add_subdirectory("${sapi}")
44+
list(POP_BACK CMAKE_MESSAGE_CONTEXT)
3845

3946
if(TARGET php_${sapi})
4047
set_property(GLOBAL APPEND PROPERTY PHP_SAPIS ${sapi})

patches/8.5/cmake.patch

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ Subject: Add CMake changes for PHP-8.5 branch
77
and ext/ext_skel.php script
88
---
99
.editorconfig | 2 +-
10-
.gitignore | 43 ++++++++++++++++++++++++++++++++++++++
10+
.gitignore | 44 ++++++++++++++++++++++++++++++++++++++
1111
ext/ext_skel.php | 2 ++
12-
ext/skeleton/.gitignore.in | 21 +++++++++++++++++++
12+
ext/skeleton/.gitignore.in | 22 +++++++++++++++++++
1313
run-tests.php | 24 +++++++++++++++------
14-
5 files changed, 85 insertions(+), 7 deletions(-)
14+
5 files changed, 87 insertions(+), 7 deletions(-)
1515

1616
diff --git a/.editorconfig b/.editorconfig
1717
index 7911bf8490..1d9b530947 100644
@@ -27,17 +27,18 @@ index 7911bf8490..1d9b530947 100644
2727
indent_style = space
2828

2929
diff --git a/.gitignore b/.gitignore
30-
index d54334f599..db362020fe 100644
30+
index d54334f599..b879e2a5c3 100644
3131
--- a/.gitignore
3232
+++ b/.gitignore
33-
@@ -297,3 +297,46 @@ tmp-php.ini
33+
@@ -297,3 +297,47 @@ tmp-php.ini
3434
!/ext/dom/lexbor/patches/*.patch
3535
!/ext/pcre/pcre2lib/config.h
3636
!/win32/build/Makefile
3737
+
3838
+# ------------------------------------------------------------------------------
3939
+# CMake-based build system files
4040
+# ------------------------------------------------------------------------------
41+
+!cmake/modules/
4142
+cmake_install.cmake
4243
+CMakeCache.txt
4344
+CMakeFiles/
@@ -91,17 +92,18 @@ index ae7a3a987c..62241fff9c 100755
9192

9293
foreach($files as $config_script) {
9394
diff --git a/ext/skeleton/.gitignore.in b/ext/skeleton/.gitignore.in
94-
index e691bd3964..fff9fc09d0 100644
95+
index e691bd3964..c4077b0a8d 100644
9596
--- a/ext/skeleton/.gitignore.in
9697
+++ b/ext/skeleton/.gitignore.in
97-
@@ -45,3 +45,24 @@ tests/**/*.db
98+
@@ -45,3 +45,25 @@ tests/**/*.db
9899
tests/**/*.mem
99100
tmp-php.ini
100101
*~
101102
+
102103
+# ------------------------------------------------------------------------------
103104
+# CMake-based build system files
104105
+# ------------------------------------------------------------------------------
106+
+!cmake/modules/
105107
+/_deps/
106108
+/.ninja*
107109
+/*.dependers

0 commit comments

Comments
 (0)