Skip to content

Commit 9a5e1ff

Browse files
committed
Merge branch 'PHP-8.4'
2 parents 4f0d99c + a0c5794 commit 9a5e1ff

File tree

5 files changed

+46
-23
lines changed

5 files changed

+46
-23
lines changed

cmake/Zend/CMakeLists.txt

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,30 @@
11
#[=============================================================================[
22
Zend Engine.
33
4-
## Targets
4+
Targets:
55
6-
* OBJECT library `zend` (ALIAS `Zend::Zend`) holds all Zend Engine objects
7-
and compile properties.
6+
* OBJECT library 'zend' (ALIAS Zend::Zend) holds all Zend Engine objects and
7+
compile properties.
88
9-
## Target properties
9+
Target properties:
1010
11-
CMake target properties for the `Zend::Zend` target:
11+
CMake target properties for the Zend::Zend target:
1212
13-
* `VERSION`
14-
15-
Zend Engine version as defined in the `Zend/zend.h` file.
16-
17-
* `ZEND_EXTENSION_API_NO`
13+
* VERSION
14+
Zend Engine version as defined in the Zend/zend.h file.
1815
16+
* ZEND_EXTENSION_API_NO
1917
Custom target property with internal API version number for PHP extensions
20-
(dynamically loaded with the `extension` INI directive). This is the
21-
`ZEND_MODULE_API_NO` number from the `Zend/zend_modules.h` and ensures that
22-
built extension is compatible with particular PHP build.
23-
24-
* `ZEND_MODULE_API_NO`
18+
(dynamically loaded with the 'extension' INI directive). This is the
19+
ZEND_MODULE_API_NO number from the Zend/zend_modules.h and ensures that built
20+
extension is compatible with particular PHP build.
2521
22+
* ZEND_MODULE_API_NO
2623
Custom target property with internal API version number for Zend extensions in
27-
PHP (dynamically loaded with the `zend_extension` INI directive), such as
28-
opcache, debuggers, profilers, etc. This is the `ZEND_EXTENSION_API_NO` number
29-
from the `Zend/zend_extensions.h` and ensures that built extension is
30-
compatible with particular PHP build.
24+
PHP (dynamically loaded with the 'zend_extension' INI directive), such as
25+
opcache, debuggers, profilers, etc. This is the ZEND_EXTENSION_API_NO number
26+
from the Zend/zend_extensions.h and ensures that built extension is compatible
27+
with particular PHP build.
3128
#]=============================================================================]
3229

3330
message(STATUS "")

cmake/cmake/Version.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ number from the php-src main/php.h header file.
66
77
Variables:
88
9-
* `PHP_API_VERSION`
10-
* `PHP_VERSION`
11-
* `PHP_VERSION_LABEL`
9+
* PHP_API_VERSION
10+
* PHP_VERSION
11+
* PHP_VERSION_LABEL
1212
#]=============================================================================]
1313

1414
include_guard(GLOBAL)

cmake/ext/standard/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,16 @@ target_sources(
501501
add_dependencies(php_ext_standard_functions php_ext_standard)
502502
add_dependencies(php_ext_standard_functions_cli php_ext_standard)
503503

504+
################################################################################
505+
# ext/standard depends on ext/zlib for SWC images and transitively depends on
506+
# the zlib library.
507+
# TODO: https://github.com/php/php-src/pull/4681
508+
################################################################################
509+
510+
if(PHP_EXT_ZLIB)
511+
add_dependencies(php_ext_standard php_ext_zlib)
512+
endif()
513+
504514
################################################################################
505515
# Configuration header
506516
################################################################################

cmake/ext/zlib/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ set_package_properties(
8585
PURPOSE "Necessary to enable the zlib extension."
8686
)
8787

88-
target_link_libraries(php_ext_zlib PRIVATE ZLIB::ZLIB)
88+
# Link publicly for internal_functions files.
89+
target_link_libraries(php_ext_zlib PUBLIC ZLIB::ZLIB)
8990

9091
set(HAVE_ZLIB TRUE)
9192

cmake/main/CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ target_sources(php_sapi INTERFACE $<TARGET_OBJECTS:PHP::main>)
161161
# Add FastCGI target with objects for use in PHP SAPIs such as CGI and FPM.
162162
################################################################################
163163
add_library(php_main_fastcgi OBJECT fastcgi.c)
164+
add_dependencies(php_main_fastcgi php_main)
164165

165166
target_sources(
166167
php_sapi
@@ -175,6 +176,8 @@ target_sources(
175176

176177
add_library(php_main_internal_functions OBJECT internal_functions.c)
177178
add_library(php_main_internal_functions_cli OBJECT internal_functions_cli.c)
179+
add_dependencies(php_main_internal_functions php_main)
180+
add_dependencies(php_main_internal_functions_cli php_main)
178181

179182
target_sources(
180183
php_sapi
@@ -260,6 +263,18 @@ file(CONFIGURE OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/php_version.h CONTENT [[
260263
#define PHP_VERSION_ID @PHP_VERSION_ID@
261264
]])
262265

266+
################################################################################
267+
# When building external libraries with ExternalProject module, the library (and
268+
# its accompanying extension) should be built before the main target so the
269+
# internal functions files have possible library headers available when used in
270+
# extension headers (for example, php_openssl.h, php_zlib.h, etc.).
271+
################################################################################
272+
273+
get_property(extensions GLOBAL PROPERTY PHP_EXTENSIONS)
274+
foreach(extension IN LISTS extensions)
275+
add_dependencies(php_main PHP::ext::${extension})
276+
endforeach()
277+
263278
################################################################################
264279
# Generate configuration headers.
265280
################################################################################

0 commit comments

Comments
 (0)